[][src]Struct drying_paint::WatcherMeta

pub struct WatcherMeta<'a, T: ?Sized> { /* fields omitted */ }

This structure is used internally by Watcher. It is passed to the init function of WatcherInit, the trait which is required to be implemented by the data stored in Watchers.

Implementations

impl<T: 'static, '_> WatcherMeta<'_, T>[src]

pub fn id(&self) -> WatcherId[src]

Get a value representing a unique id for the watcher this WatcherMeta was created for. 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.

impl<T: ?Sized + 'static, '_> WatcherMeta<'_, T>[src]

pub fn watch<F>(&mut self, func: F) where
    F: Fn(&mut T) + 'static, 
[src]

Use this to set up a function which should be re-run whenever watched values referenced inside change.

pub fn set_debug_name(&mut self, debug_name: &'static str)[src]

Watches have a debug name used in some error messages. It defaults to the type name of the associated content (T). This function allows overriding that name.

Auto Trait Implementations

impl<'a, T> !RefUnwindSafe for WatcherMeta<'a, T>

impl<'a, T> !Send for WatcherMeta<'a, T>

impl<'a, T> !Sync for WatcherMeta<'a, T>

impl<'a, T: ?Sized> Unpin for WatcherMeta<'a, T>

impl<'a, T> !UnwindSafe for WatcherMeta<'a, 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, 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.