/// Test to see whether this source fulfills any condition listed in `mask`
/// provided.
///
/// The `mask` given here is a mio `Ready` set of possible events. This can
/// contain any events like read/write but also platform-specific events
/// such as hup and error. The `mask` indicates events that are interested
/// in being ready.
///
/// If any event in `mask` is ready then it is returned through
/// `Async::Ready`. The `Ready` set returned is guaranteed to not be empty
/// and contains all events that are currently ready in the `mask` provided.
///
/// If no events are ready in the `mask` provided then the current task is
/// scheduled to receive a notification when any of them become ready. If
/// the `writable` event is contained within `mask` then this
/// `PollEvented`'s `write` task will be blocked and otherwise the `read`
/// task will be blocked. This is generally only relevant if you're working
/// with this `PollEvented` object on multiple tasks.
///
/// # Panics
///
/// This function will panic if called outside the context of a future's
/// task.
Test to see whether this source fulfills any condition listed in `mask`
provided.

The `mask` given here is a mio `Ready` set of possible events. This can
contain any events like read/write but also platform-specific events
such as hup and error. The `mask` indicates events that are interested
in being ready.

If any event in `mask` is ready then it is returned through
`Async::Ready`. The `Ready` set returned is guaranteed to not be empty
and contains all events that are currently ready in the `mask` provided.

If no events are ready in the `mask` provided then the current task is
scheduled to receive a notification when any of them become ready.
Test to see whether this source fulfills any condition listed in ` mask ` provided . The ` mask ` given here is a mio ` Ready ` set of possible events . This can contain any events like read / write but also platform - specific events such as hup and error . The ` mask ` indicates events that are interested in being ready . If any event in ` mask ` is ready then it is returned through ` Async :: Ready ` . The ` Ready ` set returned is guaranteed to not be empty and contains all events that are currently ready in the ` mask ` provided . If no events are ready in the ` mask ` provided then the current task is scheduled to receive a notification when any of them become ready .
pub fn poll_ready(&mut self, mask: Ready) -> Async<Ready> {
        let bits = super::ready2usize(mask);
        match self.readiness & bits {
            0 => {}
            n => return Async::Ready(super::usize2ready(n)),
        }
        let token_readiness = self.handle.inner().map(|inner| {
            let io_dispatch = inner.io_dispatch.read().unwrap();
            io_dispatch[self.token].readiness.swap(0, Ordering::SeqCst)
        }).unwrap_or(0);
        self.readiness |= token_readiness;
        match self.readiness & bits {
            0 => {
                if mask.is_writable() {
                    if self.need_write().is_err() {
                        return Async::Ready(mask)
                    }
                } else {
                    if self.need_read().is_err() {
                        return Async::Ready(mask)
                    }
                }
                Async::NotReady
            }
            n => Async::Ready(super::usize2ready(n)),
        }
    }
pub fn poll_ready ( & mut self , mask : Ready ) -> Async < Ready > { let bits = super :: ready2usize ( mask ) ; match self . readiness & bits { 0 => { } n => return Async :: Ready ( super :: usize2ready ( n ) ) , } let token_readiness = self . handle . inner ( ) . map ( | inner | { let io_dispatch = inner . io_dispatch . read ( ) . unwrap ( ) ; io_dispatch [ self . token ] . readiness . swap ( 0 , Ordering :: SeqCst ) } ) . unwrap_or ( 0 ) ; self . readiness |= token_readiness ; match self . readiness & bits { 0 => { if mask . is_writable ( ) { if self . need_write ( ) . is_err ( ) { return Async :: Ready ( mask ) } } else { if self . need_read ( ) . is_err ( ) { return Async :: Ready ( mask ) } } Async :: NotReady } n => Async :: Ready ( super :: usize2ready ( n ) ) , } }
Test to see whether this source fulfills any condition listed in `mask`
provided.
Test to see whether this source fulfills any condition listed in ` mask ` provided .
&mut self
mask
Ready
panics
This function will panic if called outside the context of a future's
task.
This function will panic if called outside the context of a future ' s task .