[][src]Struct threader::reactor::observer::Observer

pub struct Observer<R: Evented> { /* fields omitted */ }

A type that "observes" changes in a resource's state from the reactor, waking from the IoWaker if a change is detected.

Methods

impl<R: Evented> Observer<R>[src]

pub fn new(resource: R, interest: Ready, opts: PollOpt) -> Result<Self>[src]

Creates a new instance of Observer

pub fn with_handle(
    resource: R,
    interest: Ready,
    opts: PollOpt,
    handle: Handle
) -> Result<Self>
[src]

Creates a new instance of Observer with the given reactor handle.

pub fn from_other(resource: R, other: &Self) -> Self[src]

Creates an Observer from another using a different resource but the same IoWaker and Handle.

pub fn get_ref(&self) -> &R[src]

Returns a reference to the underlying resource.

pub fn get_mut(&mut self) -> &mut R[src]

Returns a mutable reference to the underlying resource.

pub fn io_waker(&self) -> Arc<IoWaker>[src]

Clones the internal IoWaker and returns it.

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

Clones the internal Handle and returns it.

pub fn reregister(&self, interest: Ready, opts: PollOpt) -> Result<()>[src]

Reregisters the underlying resource with the internal Handle.

pub fn deregister(&self) -> Result<()>[src]

Deregisters a resource from the reactor that drives it.

pub fn poll_readable(&self, cx: &mut Context) -> Poll<Ready>[src]

Polls for read readiness.

pub fn poll_writable(&self, cx: &mut Context) -> Poll<Ready>[src]

Polls for write readiness.

pub async fn await_readable<'_>(&'_ self) -> Ready[src]

A convenience method for wrapping poll_readable in a future.

pub async fn await_writable<'_>(&'_ self) -> Ready[src]

A convenience method for wrapping poll_writable in a future.

Trait Implementations

impl<E: Evented> Drop for Observer<E>[src]

impl<R: Debug + Evented> Debug for Observer<R>[src]

impl<E: Evented + Read> Read for Observer<E>[src]

impl<E: Evented + Write> Write for Observer<E>[src]

Auto Trait Implementations

impl<R> Send for Observer<R> where
    R: Send

impl<R> Sync for Observer<R> where
    R: Sync

impl<R> Unpin for Observer<R> where
    R: Unpin

impl<R> !UnwindSafe for Observer<R>

impl<R> !RefUnwindSafe for Observer<R>

Blanket Implementations

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

impl<T> From<T> for 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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