pub fn register_dispatcher<S>(
        &self,
        dispatcher: Dispatcher<'l, S, Data>,
    ) -> io::Result<RegistrationToken>
    where
        S: EventSource + 'l,
    {
        let mut sources = self.inner.sources.borrow_mut();
        let mut poll = self.inner.poll.borrow_mut();

        let key = sources.insert(dispatcher.clone_as_event_dispatcher());
        let ret = sources
            .get(key)
            .unwrap()
            .register(&mut *poll, &mut TokenFactory::new(key));

        if let Err(error) = ret {
            sources.remove(key).expect("Source was just inserted?!");
            return Err(error);
        }

        Ok(RegistrationToken { key })
    }
/// Registers a `Dispatcher` in the loop.
///
/// Use this function if you need access to the event source after its insertion in the loop.
///
/// See also `insert_source`.
Registers a `Dispatcher` in the loop.
Use this function if you need access to the event source after its insertion in the loop.


Registers a ` Dispatcher ` in the loop . Use this function if you need access to the event source after its insertion in the loop .
pub fn register_dispatcher<S>(
        &self,
        dispatcher: Dispatcher<'l, S, Data>,
    ) -> io::Result<RegistrationToken>
    where
        S: EventSource + 'l,
    {
        let mut sources = self.inner.sources.borrow_mut();
        let mut poll = self.inner.poll.borrow_mut();
        let key = sources.insert(dispatcher.clone_as_event_dispatcher());
        let ret = sources
            .get(key)
            .unwrap()
            .register(&mut *poll, &mut TokenFactory::new(key));
        if let Err(error) = ret {
            sources.remove(key).expect("Source was just inserted?!");
            return Err(error);
        }
        Ok(RegistrationToken { key })
    }
pub fn register_dispatcher < S > ( & self , dispatcher : Dispatcher < ' l , S , Data > , ) -> io :: Result < RegistrationToken > where S : EventSource + ' l , { let mut sources = self . inner . sources . borrow_mut ( ) ; let mut poll = self . inner . poll . borrow_mut ( ) ; let key = sources . insert ( dispatcher . clone_as_event_dispatcher ( ) ) ; let ret = sources . get ( key ) . unwrap ( ) . register ( & mut * poll , & mut TokenFactory :: new ( key ) ) ; if let Err ( error ) = ret { sources . remove ( key ) . expect ( " " ) ; return Err ( error ) ; } Ok ( RegistrationToken { key } ) }
Registers a `Dispatcher` in the loop.
Registers a ` Dispatcher ` in the loop .
&self
dispatcher
Dispatcher<'l, S, Data>
&self
dispatcher
Dispatcher<'l, S, Data>