pub struct Atom<V> { /* private fields */ }Implementations§
Source§impl<V> Atom<V>
impl<V> Atom<V>
pub fn new(value: V) -> Self
pub fn same_identity(&self, other: &Self) -> bool
pub fn identity_address(&self) -> usize
pub fn with_validator( value: V, validator: impl Fn(&V) -> bool + Send + Sync + 'static, ) -> Self
pub fn add_watch( &self, key: impl Into<String>, watch: impl Fn(&WatchEntry<V>) + Send + Sync + 'static, )
pub fn remove_watch(&self, key: &str)
Trait Implementations§
Source§impl<V: Clone> IWatch<V> for Atom<V>
impl<V: Clone> IWatch<V> for Atom<V>
type Key = String
type WatchEntry = WatchEntry<V>
fn add_watch( &self, key: Self::Key, watch: impl Fn(&Self::WatchEntry) + Send + Sync + 'static, )
fn remove_watch(&self, key: &Self::Key)
fn notify_watches(&self, old_value: V, new_value: V)
fn list_watches(&self) -> Vec<Self::WatchEntry>
Auto Trait Implementations§
impl<V> !RefUnwindSafe for Atom<V>
impl<V> !UnwindSafe for Atom<V>
impl<V> Freeze for Atom<V>
impl<V> Send for Atom<V>
impl<V> Sync for Atom<V>
impl<V> Unpin for Atom<V>
impl<V> UnsafeUnpin for Atom<V>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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