pub struct ComputedVar {
pub key: String,
pub dependencies: Vec<String>,
pub compute: Arc<dyn Fn(&State) -> Option<Value> + Send + Sync>,
}Expand description
Fields§
§key: StringThe state key this computed variable writes to (prefixed with derived:).
dependencies: Vec<String>State keys this variable depends on.
compute: Arc<dyn Fn(&State) -> Option<Value> + Send + Sync>Closure that computes the derived value from current state.
Auto Trait Implementations§
impl Freeze for ComputedVar
impl !RefUnwindSafe for ComputedVar
impl Send for ComputedVar
impl Sync for ComputedVar
impl Unpin for ComputedVar
impl !UnwindSafe for ComputedVar
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more