[][src]Struct ice_threads::Bottle

pub struct Bottle<W>(_, _);

Water Bottle.

The Bottle must be held and used, otherwise it will Shatter.

Allows to access Water that was produced by melting Ice.

Methods

impl<W> Bottle<W>[src]

pub fn open(&self) -> W[src]

Opens the Bottle, granting access to Water.

The Bottle is consumed in the process.

Blocking

This operation blocks till the Heater is done melting Ice.

Panics

  • When the Bottle has already been opened.
  • When the Bottle is Poisoned1. Poisoning1 happens when Heater melting the Ice fails. Irrecoverable.

1 - Not to be confused with Poisoning of the Mutex, although Bottle is Poisoned because of a very similar reason - panic in a thread.

Trait Implementations

impl<T> Drop for Bottle<T>[src]

fn drop(&mut self)[src]

Drops the Bottle.

Panics

When Bottle is dropped without ever being used. This causes it to shatter.

It is completely user's responsibility to ensure that bottle is not dropped without being used.

Auto Trait Implementations

impl<W> Send for Bottle<W> where
    W: Send

impl<W> !Sync for Bottle<W>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]