Struct Melter

Source
pub struct Melter { /* private fields */ }
Expand description

Ice Melter.

This struct is responsible for queueing all the Ice to be molten using it’s Heaters.

Implementations§

Source§

impl Melter

Source

pub fn new(count: usize) -> Melter

Creates a new Ice Melter with specified amount of Heaters.

§Panics

When count is zero.

Source

pub fn melt<I, W>(&self, ice: I) -> Bottle<W>
where I: FnOnce() -> W + Send + 'static, W: Send + 'static,

Enqueues Ice to be molten.

Returns a Bottle which will be filled with Water coming from given Ice.

§Panics

When all Heaters fail.

This should generally be impossible unless the user’s code happens to have a bug, panics and doesn’t open the poisoned Bottle that would stop the process earlier.

Trait Implementations§

Source§

impl Drop for Melter

Source§

fn drop(&mut self)

Gracefully powers down all Heaters.

Auto Trait Implementations§

§

impl Freeze for Melter

§

impl !RefUnwindSafe for Melter

§

impl Send for Melter

§

impl Sync for Melter

§

impl Unpin for Melter

§

impl !UnwindSafe for Melter

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.