[−][src]Struct drying_paint::Watcher
Watcher is a structure designed to hold some data along with associated functions which will run when watched data changes.
Implementations
impl<T: WatcherInit> Watcher<T>
[src]
pub fn create(data: T) -> Self
[src]
Create a new Watcher. After creation, will run WatcherInit::init for the stored data. Watchers need to be created inside WatchContext::allow_watcher_access() in order to observe aliasing rules.
pub fn into_inner(self) -> T
[src]
Consume the Watcher and return the data stored inside. Watch callbacks will no longer run.
impl<T: WatcherInit + ?Sized> Watcher<T>
[src]
pub fn data(&self) -> &T
[src]
Get an immutable reference to the data stored in this Watcher. In order to ensure aliasing rules are maintained, this function will panic if called outside a watch callback or WatchContext::allow_watcher_access
pub fn data_mut(&mut self) -> &mut T
[src]
Get an mutable reference to the data stored in this Watcher. In order to ensure aliasing rules are maintained, this function will panic if called outside a watch callback or WatchContext::allow_watcher_access
impl<T: WatcherInit + Default> Watcher<T>
[src]
pub fn new() -> Self
[src]
Create a Watcher with default data. After creation, will run WatcherInit::init for the stored data.
impl<T: 'static> Watcher<T>
[src]
pub fn id(&self) -> WatcherId
[src]
Get a value representing a unique id for this watcher. This value may outlive the watcher, and will never compare equal to a value returned by the id method of a Watcher other than this one.
Trait Implementations
impl<T: WatcherInit + Clone> Clone for Watcher<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: WatcherInit + Default> Default for Watcher<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Watcher<T>
impl<T> !Send for Watcher<T>
impl<T> !Sync for Watcher<T>
impl<T: ?Sized> Unpin for Watcher<T>
impl<T> !UnwindSafe for Watcher<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,