pub struct Watch<T: Copy>(/* private fields */);Expand description
A “latest only” value store with unlimited writers and async waiting. Value is always available once initialized.
Implementations§
Source§impl<T: Copy> Watch<T>
impl<T: Copy> Watch<T>
Sourcepub fn split(&self) -> (WatchWriter<'_, T>, WatchReader<'_, T>)
pub fn split(&self) -> (WatchWriter<'_, T>, WatchReader<'_, T>)
Split the watch into a writer and watch reader.
Trait Implementations§
impl<T: Copy> Send for Watch<T>
impl<T: Copy> Sync for Watch<T>
Auto Trait Implementations§
impl<T> !Freeze for Watch<T>
impl<T> !RefUnwindSafe for Watch<T>
impl<T> Unpin for Watch<T>where
T: Unpin,
impl<T> UnsafeUnpin for Watch<T>where
T: UnsafeUnpin,
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