Struct mini_rx::Var

source · []
pub struct Var<'c, T>(_);
Expand description

Index into the RxDAG which will give you a variable.

To actually get or set the value you need a shared reference to the RxDAG.

Implementations

Read the variable

Write a new value to the variable. The changes will be applied on recompute.

Apply a transformation to the latest value. If Var::set this will apply to the recently-set value. This must be used instead of chaining Var::set and Var::get, since setting a value doesn’t make it returned by Var::get until the graph is recomputed.

Like set the changes only actually reflect in Var::get on recompute.

Create a view of part of the variable.

Do know that SetFn will take the most recently-set value even if the graph hasn’t been recomputed. This means you can create multiple derives and set them all before recompute, and you don’t have to worry about the later derived values setting their part on the stale whole.

Create a view of part of the variable, which clones the value on set.

Do know that SetFn will take the most recently-set value even if the graph hasn’t been recomputed. This means you can create multiple derives and set them all before recompute, and you don’t have to worry about the later derived values setting their part on the stale whole.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.