pub enum Watched<T: Debug> {
Completed(T),
Messaged(Message),
}
Expand description
A result from watch()
.
Variants§
Implementations§
Source§impl<T: Debug> Watched<T>
impl<T: Debug> Watched<T>
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
True if the future completed.
Sourcepub fn is_messaged(&self) -> bool
pub fn is_messaged(&self) -> bool
True if we received a message.
Sourcepub fn unwrap_completed(self) -> T
pub fn unwrap_completed(self) -> T
Take the completed result or panic.
Sourcepub fn unwrap_messaged(self) -> Message
pub fn unwrap_messaged(self) -> Message
Take the received message or panic.
Trait Implementations§
impl<T: Debug + Eq> Eq for Watched<T>
Auto Trait Implementations§
impl<T> Freeze for Watched<T>where
T: Freeze,
impl<T> RefUnwindSafe for Watched<T>where
T: RefUnwindSafe,
impl<T> Send for Watched<T>where
T: Send,
impl<T> Sync for Watched<T>where
T: Sync,
impl<T> Unpin for Watched<T>where
T: Unpin,
impl<T> UnwindSafe for Watched<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