pub struct Watch<T> { /* private fields */ }Expand description
Watch channel for state monitoring with change notifications
Implementations§
Source§impl<T: Clone + Send + 'static> Watch<T>
impl<T: Clone + Send + 'static> Watch<T>
Sourcepub fn new(initial: T) -> (WatchSender<T>, WatchReceiver<T>)
pub fn new(initial: T) -> (WatchSender<T>, WatchReceiver<T>)
Create a new watch channel with an initial value Returns (sender, receiver) tuple per channel pattern conventions
Auto Trait Implementations§
impl<T> Freeze for Watch<T>where
PhantomData<T>: Freeze,
impl<T> RefUnwindSafe for Watch<T>where
PhantomData<T>: RefUnwindSafe,
impl<T> Send for Watch<T>where
PhantomData<T>: Send,
impl<T> Sync for Watch<T>where
PhantomData<T>: Sync,
impl<T> Unpin for Watch<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for Watch<T>where
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for Watch<T>where
PhantomData<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