pub(crate) struct Source {
registration: Registration,
key: usize,
state: Mutex<[Direction; 2]>,
}
Expand description
A registered source of I/O events.
Fields§
§registration: Registration
This source’s registration into the reactor.
key: usize
The key of this source obtained during registration.
state: Mutex<[Direction; 2]>
Inner state with registered wakers.
Implementations§
Source§impl Source
impl Source
Sourcepub(crate) fn poll_readable(&self, cx: &mut Context<'_>) -> Poll<Result<()>>
pub(crate) fn poll_readable(&self, cx: &mut Context<'_>) -> Poll<Result<()>>
Polls the I/O source for readability.
Sourcepub(crate) fn poll_writable(&self, cx: &mut Context<'_>) -> Poll<Result<()>>
pub(crate) fn poll_writable(&self, cx: &mut Context<'_>) -> Poll<Result<()>>
Polls the I/O source for writability.
Sourcefn poll_ready(&self, dir: usize, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_ready(&self, dir: usize, cx: &mut Context<'_>) -> Poll<Result<()>>
Registers a waker from poll_readable()
or poll_writable()
.
If a different waker is already registered, it gets replaced and woken.
Sourcepub(crate) fn readable<T>(handle: &Async<T>) -> Readable<'_, T> ⓘ
pub(crate) fn readable<T>(handle: &Async<T>) -> Readable<'_, T> ⓘ
Waits until the I/O source is readable.
Sourcepub(crate) fn readable_owned<T>(handle: Arc<Async<T>>) -> ReadableOwned<T> ⓘ
pub(crate) fn readable_owned<T>(handle: Arc<Async<T>>) -> ReadableOwned<T> ⓘ
Waits until the I/O source is readable.
Sourcepub(crate) fn writable<T>(handle: &Async<T>) -> Writable<'_, T> ⓘ
pub(crate) fn writable<T>(handle: &Async<T>) -> Writable<'_, T> ⓘ
Waits until the I/O source is writable.
Sourcepub(crate) fn writable_owned<T>(handle: Arc<Async<T>>) -> WritableOwned<T> ⓘ
pub(crate) fn writable_owned<T>(handle: Arc<Async<T>>) -> WritableOwned<T> ⓘ
Waits until the I/O source is writable.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more