[−][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.
Methods
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.
impl<T: WatcherInit + ?Sized> Watcher<T>
[src]
pub fn data(&self) -> Ref<T>
[src]
Get an immutable reference to the data stored in this Watcher. Note that this follows the same rules as RefCell, and may panic if the runtime borrow checker detects and invalid borrow.
pub fn data_mut(&mut self) -> RefMut<T>
[src]
Get an mutable reference to the data stored in this Watcher. Note that this follows the same rules as RefCell, and may panic if the runtime borrow checker detects and invalid borrow.
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.
Trait Implementations
Auto Trait Implementations
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>
impl<T> !RefUnwindSafe for Watcher<T>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,