pub struct Watch<T> { /* private fields */ }
Available on crate features
runtime
and component-model
and component-model-async
only.Expand description
Wrapper struct which may be converted to the inner value as needed.
This object is normally paired with a Future
which represents a state
change on the inner value, resolving when that state change happens or
when the Watch
is converted back into the inner value – whichever happens
first.
Implementations§
Source§impl<T> Watch<T>
impl<T> Watch<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Convert this object into its inner value.
Calling this function will cause the associated Future
to resolve
immediately if it hasn’t already.
Auto Trait Implementations§
impl<T> Freeze for Watch<T>where
T: Freeze,
impl<T> RefUnwindSafe for Watch<T>where
T: RefUnwindSafe,
impl<T> Send for Watch<T>where
T: Send,
impl<T> Sync for Watch<T>where
T: Sync,
impl<T> Unpin for Watch<T>where
T: Unpin,
impl<T> UnwindSafe for Watch<T>where
T: 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more