[][src]Struct fumio_reactor::reactor::PollEvented

pub struct PollEvented<E> where
    E: Evented
{ /* fields omitted */ }

A wrapper for Read and Write based IO sources.

Methods

impl<E> PollEvented<E> where
    E: Evented
[src]

pub fn new(io: E, handle: LazyHandle) -> Self[src]

Wrap io and lazily bind to handle on first use.

pub fn try_mut_read<F, T>(
    &mut self,
    context: &mut Context,
    read_op: F
) -> Poll<Result<T>> where
    F: FnMut(&mut E) -> Poll<Result<T>>, 
[src]

Try a read operation with mutable IO

If read operation fails make sure to get notified when read readiness is signalled.

pub fn poll_read_ready(&self, context: &mut Context) -> Poll<Result<Ready>>[src]

Clears all pending read events (and returns them)

If no events were pending (and possibly even if there were) the waker in context is registered to be notified when new read events are pending.

pub fn try_mut_write<F, T>(
    &mut self,
    context: &mut Context,
    write_op: F
) -> Poll<Result<T>> where
    F: FnMut(&mut E) -> Poll<Result<T>>, 
[src]

Try a write operation with mutable IO

If write operation fails make sure to get notified when write readiness is signalled.

pub fn poll_write_ready(&self, context: &mut Context) -> Poll<Result<Ready>>[src]

Clears all pending write events (and returns them)

If no events were pending (and possibly even if there were) the waker in context is registered to be notified when new write events are pending.

pub fn io_ref(&self) -> &E[src]

Retrieve reference to the contained IO

pub fn io_mut(&mut self) -> &mut E[src]

Retrieve mutable reference to the contained IO

pub fn handle(&self) -> LazyHandle[src]

Retrieve reactor handle this is (going to) be bound to.

Returns an unbound LazyHandle if not registered and not explicitly bound itself.

pub fn into_inner(self) -> E[src]

Detach inner io from reactor and extract it.

Trait Implementations

impl<E: Debug> Debug for PollEvented<E> where
    E: Evented
[src]

impl<R: Evented + Read + Unpin> AsyncRead for PollEvented<R>[src]

unsafe fn initializer(&self) -> Initializer[src]

Determines if this AsyncReader can work with buffers of uninitialized memory. Read more

fn poll_read_vectored(
    self: Pin<&mut Self>,
    cx: &mut Context,
    bufs: &mut [IoSliceMut]
) -> Poll<Result<usize, Error>>
[src]

Attempt to read from the AsyncRead into bufs using vectored IO operations. Read more

impl<R: Evented + Write + Unpin> AsyncWrite for PollEvented<R>[src]

fn poll_write_vectored(
    self: Pin<&mut Self>,
    cx: &mut Context,
    bufs: &[IoSlice]
) -> Poll<Result<usize, Error>>
[src]

Attempt to write bytes from bufs into the object using vectored IO operations. Read more

Auto Trait Implementations

impl<E> Unpin for PollEvented<E> where
    E: Unpin

impl<E> Send for PollEvented<E> where
    E: Send

impl<E> Sync for PollEvented<E> where
    E: Sync

impl<E> !UnwindSafe for PollEvented<E>

impl<E> !RefUnwindSafe for PollEvented<E>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]