[][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.

Trait Implementations

impl<T: WatcherInit + Default> Default for Watcher<T>[src]

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]

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

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

type Error = !

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.

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]