Struct bombs::Bomb

source ·
pub struct Bomb<T> { /* private fields */ }
Expand description

A one-time use bomb.

The Fuse<T> for this Bomb can be lit only once, and the bomb will remain in an exploded state for the remainder of the existence of this instance.

Bombs can be safely cloned and sent between threads.

Implementations§

Creates a new single producer Fuse<T>, and a multi-consumer Bomb<T>.

Instances of Bomb<T> may be safely cloned and sent between threads.

Returns Some if the Bomb has exploded.

Once the Bomb has exploded, it will remain in an exploded state for the remainder of the existence of this Bomb instance. It is expected that the Bomb is dropped after explosion, to notify the original Fuse (now Flame) that this Bomb has completed processing the data.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. 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.