Struct stream_cancel::Valve

source ·
pub struct Valve(_);
Expand description

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.

Implementations§

Make a new Valve and an associated Trigger.

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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.