pub enum AsyncStatus<T> {
Ready(T),
Read,
Write,
UserControlled,
}Expand description
The status of an async function.
An async function can either be ready, or be unready for a number of reasons. This enum is used to represent the status of an async function.
It can be thought of as similar to Poll, but instead of returning
Pending, it returns the exact reason why it is pending.
Variants§
Ready(T)
The function’s result is ready.
Read
We are waiting for a read to be available.
Write
We are waiting for a write to be available.
UserControlled
We are waiting for something else.
The implementation is expected to wake the provided waker once the function is ready to be called again.
Implementations§
Source§impl<T> AsyncStatus<T>
impl<T> AsyncStatus<T>
Source§impl<T: Copy> AsyncStatus<&T>
impl<T: Copy> AsyncStatus<&T>
Sourcepub fn copied(self) -> AsyncStatus<T>
pub fn copied(self) -> AsyncStatus<T>
Copy the reference in an AsyncStatus to a value.
Trait Implementations§
Source§impl<T: Clone> Clone for AsyncStatus<T>
impl<T: Clone> Clone for AsyncStatus<T>
Source§fn clone(&self) -> AsyncStatus<T>
fn clone(&self) -> AsyncStatus<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for AsyncStatus<T>
impl<T: Debug> Debug for AsyncStatus<T>
Source§impl<T: Hash> Hash for AsyncStatus<T>
impl<T: Hash> Hash for AsyncStatus<T>
Source§impl<T: Ord> Ord for AsyncStatus<T>
impl<T: Ord> Ord for AsyncStatus<T>
Source§fn cmp(&self, other: &AsyncStatus<T>) -> Ordering
fn cmp(&self, other: &AsyncStatus<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for AsyncStatus<T>
impl<T: PartialEq> PartialEq for AsyncStatus<T>
Source§impl<T: PartialOrd> PartialOrd for AsyncStatus<T>
impl<T: PartialOrd> PartialOrd for AsyncStatus<T>
impl<T: Copy> Copy for AsyncStatus<T>
impl<T: Eq> Eq for AsyncStatus<T>
impl<T> StructuralPartialEq for AsyncStatus<T>
Auto Trait Implementations§
impl<T> Freeze for AsyncStatus<T>where
T: Freeze,
impl<T> RefUnwindSafe for AsyncStatus<T>where
T: RefUnwindSafe,
impl<T> Send for AsyncStatus<T>where
T: Send,
impl<T> Sync for AsyncStatus<T>where
T: Sync,
impl<T> Unpin for AsyncStatus<T>where
T: Unpin,
impl<T> UnwindSafe for AsyncStatus<T>where
T: UnwindSafe,
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