/// Create a new event loop
///
/// Fails if the initialization of the polling system failed.
Create a new event loop
Fails if the initialization of the polling system failed.
Create a new event loop Fails if the initialization of the polling system failed .
pub fn try_new() -> io::Result<Self> {
        let poll = Poll::new()?;
        let handle = LoopHandle {
            inner: Rc::new(LoopInner {
                poll: RefCell::new(poll),
                sources: RefCell::new(SlotMap::with_key()),
                idles: RefCell::new(Vec::new()),
                pending_action: Cell::new(PostAction::Continue),
            }),
        };
        let (ping, ping_source) = crate::sources::ping::make_ping()?;
        handle.insert_source(ping_source, |_, _, _| {})?;
        Ok(EventLoop {
            handle,
            stop_signal: Arc::new(AtomicBool::new(false)),
            ping,
        })
    }
pub fn try_new ( ) -> io :: Result < Self > { let poll = Poll :: new ( ) ? ; let handle = LoopHandle { inner : Rc :: new ( LoopInner { poll : RefCell :: new ( poll ) , sources : RefCell :: new ( SlotMap :: with_key ( ) ) , idles : RefCell :: new ( Vec :: new ( ) ) , pending_action : Cell :: new ( PostAction :: Continue ) , } ) , } ; let ( ping , ping_source ) = crate :: sources :: ping :: make_ping ( ) ? ; handle . insert_source ( ping_source , | _ , _ , _ | { } ) ? ; Ok ( EventLoop { handle , stop_signal : Arc :: new ( AtomicBool :: new ( false ) ) , ping , } ) }
Create a new event loop
Fails if the initialization of the polling system failed.
Create a new event loop Fails if the initialization of the polling system failed .