Struct stream_cancel::Valve [−][src]
pub struct Valve(_);
A Valve
is associated with a Trigger
, and can be used to wrap one or more
asynchronous streams. All streams wrapped by a given Valve
(or its clones) will be
interrupted when [Trigger::close
] is called on the valve's associated handle.
Methods
impl Valve
[src]
impl Valve
pub fn new() -> (Trigger, Self)
[src]
pub fn new() -> (Trigger, Self)
Make a new Valve
and an associated Trigger
.
pub fn wrap<S>(&self, stream: S) -> Valved<S>
[src]
pub fn wrap<S>(&self, stream: S) -> Valved<S>
Wrap the given stream
with this Valve
.
When [Trigger::close
] is called on the handle associated with this valve, the given
stream will immediately yield None
.
Trait Implementations
impl Clone for Valve
[src]
impl Clone for Valve
fn clone(&self) -> Valve
[src]
fn clone(&self) -> Valve
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for Valve
[src]
impl Debug for Valve