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

A Watched value which provides interior mutability. This provides correct behavior (triggering watch functions when changed) where Watched<Cell<T>> would not, and should be slightly more performant than RefCell<Watched<T>>.

Implementations

Returns a mutable reference to the watched data.

This call borrows the WatchedCell mutably (at compile-time) which guarantees that we possess the only reference.

Treat this WatchedCell as watched, without fetching the actual value.

Create a new WatchedCell

Sets the watched value

Unwraps the WatchedCell, returning the contained value

Replaces the contained value and returns the previous value

Returns a copy of the watched value

Takes the watched value, leaving Default::default() in its place

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.