pub struct WatchedCore<'ctx, T: ?Sized, O: ?Sized = DefaultOwner> { /* private fields */ }
Expand description

This represents some value which will be interesting to watch. Watcher functions that reference this value will be re-run when this value changes.

Implementations

Create a new watched value.

Consumes the WatchedCore, returning the wrapped value

Takes the wrapped value, with a new one, returning the old value, without deinitializing either one, and notifies watchers that the value has changed.

Get a referenced to the wrapped value, binding a watch closure.

Get a mutable referenced to the wrapped value, notifying watchers that the value has changed.

Get a referenced to the wrapped value, without binding any watch closure.

Takes the wrapped value, leaving Default::default() in its place, and notifies watchers that the value has changed.

This function provides a way to set a value for a watched value only if is has changed. This is useful for cases where setting a value would otherwise cause an infinite loop.

This function provides a way to set a value for a watched value only if is has changed. This is useful for cases where setting a value would otherwise cause an infinite loop.

Trait Implementations

Returns the “default value” for a type. Read more

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts to this type from the input type.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.