Enum scoped_stream_sink::State
source · pub enum State<T, E> {
Pending,
Error(E),
RecvReady,
SendReady(T),
SendRecvReady(T),
End,
}
Expand description
State enum for StreamSink
.
Due to it’s complexity, the state of StreamSink
is represented by this enum.
Should be equivalent to Poll<Result<(Option<T>, bool), E>>
.
Implements many useful From
traits to ease conversion.
Variants§
Pending
Is pending.
Error(E)
Is erroring.
RecvReady
Ready to receive item.
SendReady(T)
Has item to send.
SendRecvReady(T)
End
Has no more data to send and cannot receive data anymore.
Implementations§
source§impl<T, E> State<T, E>
impl<T, E> State<T, E>
sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Returns true
if state is pending.
sourcepub fn unwrap_content(self) -> Result<Option<T>, E>
pub fn unwrap_content(self) -> Result<Option<T>, E>
Unwraps it’s content (if any).
Trait Implementations§
source§impl<T: PartialEq, E: PartialEq> PartialEq for State<T, E>
impl<T: PartialEq, E: PartialEq> PartialEq for State<T, E>
impl<T: Copy, E: Copy> Copy for State<T, E>
impl<T: Eq, E: Eq> Eq for State<T, E>
impl<T, E> StructuralPartialEq for State<T, E>
Auto Trait Implementations§
impl<T, E> RefUnwindSafe for State<T, E>where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, E> Send for State<T, E>
impl<T, E> Sync for State<T, E>
impl<T, E> Unpin for State<T, E>
impl<T, E> UnwindSafe for State<T, E>where
E: UnwindSafe,
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