Struct stream_cancel::Valved
source · pub struct Valved<S>(/* private fields */);
Expand description
A Valved
is wrapper around a Stream
that enables the stream to be turned off remotely to
initiate a graceful shutdown. When a new Valved
is created with Valved::new
, a handle to
that Valved
is also produced; when [Trigger::close
] is called on that handle, the
wrapped stream will immediately yield None
to indicate that it has completed.
Implementations§
Trait Implementations§
source§impl<S> Stream for Valved<S>where
S: Stream,
impl<S> Stream for Valved<S>where
S: Stream,
Auto Trait Implementations§
impl<S> !RefUnwindSafe for Valved<S>
impl<S> Send for Valved<S>where
S: Send,
impl<S> Sync for Valved<S>where
S: Sync,
impl<S> Unpin for Valved<S>where
S: Unpin,
impl<S> !UnwindSafe for Valved<S>
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
source§impl<S> StreamExt for Swhere
S: Stream,
impl<S> StreamExt for Swhere
S: Stream,
source§fn take_until_if<U>(self, until: U) -> TakeUntilIf<Self, U>
fn take_until_if<U>(self, until: U) -> TakeUntilIf<Self, U>
Take elements from this stream until the given future resolves. Read more