pub trait WatchBehavior<T: Clone>: SealedWatchBehavior<T> {
// Required methods
fn try_get(&self, id: Option<&mut u64>) -> Option<T>;
fn try_get_and(
&self,
id: Option<&mut u64>,
f: &mut dyn Fn(&T) -> bool,
) -> Option<T>;
fn contains_value(&self) -> bool;
}
Expand description
A trait representing the ‘inner’ behavior of the Watch
.
Required Methods§
Sourcefn try_get(&self, id: Option<&mut u64>) -> Option<T>
fn try_get(&self, id: Option<&mut u64>) -> Option<T>
Tries to get the value of the Watch
, marking it as seen, if an id is given.
Sourcefn try_get_and(
&self,
id: Option<&mut u64>,
f: &mut dyn Fn(&T) -> bool,
) -> Option<T>
fn try_get_and( &self, id: Option<&mut u64>, f: &mut dyn Fn(&T) -> bool, ) -> Option<T>
Tries to get the value of the Watch
if it matches the predicate function
f
, marking it as seen.
Sourcefn contains_value(&self) -> bool
fn contains_value(&self) -> bool
Checks if the Watch
is been initialized with a value.