#[repr(transparent)]pub struct Get<C>(pub C);
Expand description
Used to clone the value of a cell. Can be constructed directly or with AsyncCell::get.
Note that a single instance of Get
can be used multiple times to
consume a sequence of values. For example:
use async_cell::unsync::AsyncCell;
let cell = AsyncCell::new();
let getter = cell.get();
cell.set(1);
assert_eq!(getter.await, 1);
assert_eq!(getter.await, 1);
Tuple Fields§
§0: C
Trait Implementations§
impl<C: Copy> Copy for Get<C>
Auto Trait Implementations§
impl<C> Freeze for Get<C>where
C: Freeze,
impl<C> RefUnwindSafe for Get<C>where
C: RefUnwindSafe,
impl<C> Send for Get<C>where
C: Send,
impl<C> Sync for Get<C>where
C: Sync,
impl<C> Unpin for Get<C>where
C: Unpin,
impl<C> UnwindSafe for Get<C>where
C: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more