Struct MultiFuse

Source
pub struct MultiFuse<T: Clone> { /* private fields */ }
Expand description

A reusable fuse. It just grows back.

This MultiFuse can be lit multiple times, and will explode all MultiBomb<T> instances associated with it.

It is not necessary, but may be useful for your application, to wait for all of the MultiBombs to extinguish before lighting the MultiFuse again. Slow MultiBombs may be in an exploded state again immediately after they have finished processing data, if the MultiFuse was lit again in between processing.

Like one-time use Fuses, MultiFuses cannot be cloned, but may be moved between threads.

§Dropping

Currently, MultiBombs do not have internal logic to detect MultiFuse drops. If the MultiFuse is dropped without any additional logic, all active MultiBombs will wait indefinitely to explode.

Implementations§

Source§

impl<T: Clone> MultiFuse<T>

Source

pub fn ignite(&mut self, value: T) -> Flame

Ignites the fuse.

Explodes all MultiBombs associated to this MultiFuse. Each MultiBomb receives value.

Alias to light

Source

pub fn light(&mut self, value: T) -> Flame

Lights the fuse.

Explodes all MultiBombs associated to this MultiFuse. Each MultiBomb receives value.

Auto Trait Implementations§

§

impl<T> Freeze for MultiFuse<T>

§

impl<T> !RefUnwindSafe for MultiFuse<T>

§

impl<T> Send for MultiFuse<T>
where T: Send + Sync,

§

impl<T> Sync for MultiFuse<T>

§

impl<T> Unpin for MultiFuse<T>

§

impl<T> !UnwindSafe for MultiFuse<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.