[−][src]Trait reax::computed::ComputedValue
A trait implemented by any item which can be wrapped in a ComputedVar
.
Associated Types
type Value
The value visible within the ComputedVar
.
type Context
The context used by the update function.
Required methods
fn update(&mut self, ctx: &mut Self::Context, comp: &ComputationHandle)
Recompute the value of this item.
fn read(&self) -> &Self::Value
Cheaply get a reference to the value of this item. This function is free
to panic if update
has never been called.
Implementations on Foreign Types
impl<'a, T, C> ComputedValue for Box<dyn ComputedValue<Value = T, Context = C> + 'a>
[src]
type Value = T
type Context = C
fn update(&mut self, ctx: &mut C, comp: &ComputationHandle)
[src]
fn read(&self) -> &T
[src]
Implementors
impl<T, F, C> ComputedValue for FunctionComputed<T, F, C> where
F: FnMut(&mut C) -> T,
[src]
F: FnMut(&mut C) -> T,
type Value = T
type Context = C
fn update(&mut self, ctx: &mut C, _comp: &ComputationHandle)
[src]
fn read(&self) -> &T
[src]
impl<T, F, C> ComputedValue for MutatorComputed<T, F, C> where
F: FnMut(&mut T, &mut C),
[src]
F: FnMut(&mut T, &mut C),
type Value = T
type Context = C
fn update(&mut self, ctx: &mut C, _comp: &ComputationHandle)
[src]
fn read(&self) -> &T
[src]
impl<V, T, F> ComputedValue for FunctionMapped<V, T, F> where
V: Variable,
F: FnMut(&V::Value) -> T,
[src]
V: Variable,
F: FnMut(&V::Value) -> T,
type Value = T
type Context = ()
fn update(&mut self, _ctx: &mut (), comp: &ComputationHandle)
[src]
fn read(&self) -> &T
[src]
impl<V, T, F> ComputedValue for MutatorMapped<V, T, F> where
V: Variable,
F: FnMut(&V::Value, &mut T),
[src]
V: Variable,
F: FnMut(&V::Value, &mut T),