[−][src]Struct fumio_reactor::reactor::PollEvented
A wrapper for Read
and Write
based IO sources.
Methods
impl<E> PollEvented<E> where
E: Evented,
[src]
E: Evented,
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]
&mut self,
context: &mut Context,
read_op: F
) -> Poll<Result<T>> where
F: FnMut(&mut E) -> Poll<Result<T>>,
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]
&mut self,
context: &mut Context,
write_op: F
) -> Poll<Result<T>> where
F: FnMut(&mut E) -> Poll<Result<T>>,
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]
E: Evented,
impl<R: Evented + Read + Unpin> AsyncRead for PollEvented<R>
[src]
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
unsafe fn initializer(&self) -> Initializer
[src]
Determines if this AsyncRead
er 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]
self: Pin<&mut Self>,
cx: &mut Context,
bufs: &mut [IoSliceMut]
) -> Poll<Result<usize, Error>>
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(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context,
bufs: &[IoSlice]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
bufs: &[IoSlice]
) -> Poll<Result<usize, Error>>
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,
E: Unpin,
impl<E> Send for PollEvented<E> where
E: Send,
E: Send,
impl<E> Sync for PollEvented<E> where
E: Sync,
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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,