[][src]Struct drying_paint::Watcher

pub struct Watcher<T: ?Sized> { /* fields omitted */ }

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.

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.