[−][src]Struct threader::reactor::observer::Observer
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]
resource: R,
interest: Ready,
opts: PollOpt,
handle: Handle
) -> Result<Self>
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]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut]) -> Result<usize, Error>
1.36.0[src]
unsafe fn initializer(&self) -> Initializer
[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn bytes(self) -> Bytes<Self>
1.0.0[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,
fn take(self, limit: u64) -> Take<Self>
1.0.0[src]
impl<E: Evented + Write> Write for Observer<E>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>
1.36.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Auto Trait Implementations
impl<R> Send for Observer<R> where
R: Send,
R: Send,
impl<R> Sync for Observer<R> where
R: Sync,
R: Sync,
impl<R> Unpin for Observer<R> where
R: Unpin,
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]
U: From<T>,
impl<T> From<T> for T
[src]
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,