pub struct Bottle<W>(/* private fields */);
Expand description
Water Bottle.
The Bottle must be held and used, otherwise it will Shatter
.
Allows to access Water that was produced by melting Ice.
Implementations§
Source§impl<W> Bottle<W>
impl<W> Bottle<W>
Sourcepub fn open(&self) -> W
pub fn open(&self) -> W
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§
Auto Trait Implementations§
impl<W> !Freeze for Bottle<W>
impl<W> !RefUnwindSafe for Bottle<W>
impl<W> Send for Bottle<W>where
W: Send,
impl<W> !Sync for Bottle<W>
impl<W> Unpin for Bottle<W>
impl<W> UnwindSafe for Bottle<W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more