Crate zng_var

Crate zng_var 

Source
Expand description

Batch updated variables in an app context.

§Crate

This crate is part of the zng project.

§Cargo Features

This crate provides 3 feature flags, 1 enabled by default.

§"debug_default"

Signal the build script to enable the more features in debug builds.

Enabled by default.

§"type_names"

Add value_type_name method to get the diagnostics type name from variable values.

§"dyn_closure"

Box closures at opportune places, such as Var::map, reducing the number of monomorphised types.

This speeds-up compilation time at the cost of runtime.

Modules§

animation
Var animation types and functions.

Macros§

__context_var_local
Declares new app and context local variable.
context_var
Declares new ContextVar<T> static items.
expr_var
New variable from an expression with interpolated vars.
impl_from_and_into_var
Implements T: IntoVar<U>, T: IntoValue<U> and optionally U: From<T> without boilerplate.
merge_var
Initializes a new Var<T> with value made by merging multiple other variables.
when_var
Initializes a new conditional var.

Structs§

AnyVar
Variable of any type.
AnyVarHookArgs
Arguments for AnyVar::hook.
AnyVarModify
Mutable reference to a variable value.
AnyWhenVarBuilder
Type erased when_var! manual builder.
ArcEq
Arc value that implements equality by pointer comparison.
BoxAnyVarValue
Small box for AnyVarValue values.
ContextInitHandle
Identifies the unique context a contextual_var is in.
ContextVar
Represents a named contextual variable.
MergeVarBuilder
Build a merge_var! from any number of input vars of the same type I.
ObservableVec
Represents a Vec<T> that tracks changes when used inside a variable.
ResponderVar
Represents a read-write variable used to notify the completion of an async operation.
ResponseVar
Represents a read-only variable used to listen to a one time signal that an async operation has completed.
VARS
Variable updates and animation service.
VARS_APP
VARS APP integration.
Var
Variable of type T.
VarCapability
Kinds of interactions allowed by a Var<T> in the current update.
VarEq
Represents a Var<T> as a value inside another variable.
VarHandle
Handle to a variable or animation hook.
VarHandles
Represents a collection of var handles.
VarHookArgs
Arguments for Var::hook.
VarInstanceTag
Unique identifier of a share variable, while it is alive.
VarIsReadOnlyError
Error when an attempt to modify a variable without the MODIFY capability is made.
VarMergeInputs
Input arguments for the merge closure of MergeVarBuilder merge vars.
VarModify
Mutable reference to a variable value.
VarUpdateId
Represents the last time a variable was mutated or the current update cycle.
WeakAnyVar
Weak reference to a AnyVar.
WeakContextInitHandle
Weak ContextInitHandle.
WeakVar
Weak reference to a Var<T>.
WhenVarBuilder
Manual when_var! builder.

Enums§

Response
Raw value in a ResponseVar.
VecChange
Represents a change in a ObservableVec.

Traits§

AnyVarValue
Represents any variable value.
IntoValue
A property value that is not a variable but can be inspected.
IntoVar
A value-to-var conversion that consumes the value.
VarValue
Represents a type that can be a Var<T> value.

Functions§

any_const_var
Type erased const_var.
any_contextual_var
Create a type erased contextualized variable.
any_var
New read/write shared reference type-erased variable.
any_var_derived
New read/write shared reference type-erased variable that has initial value derived from source.
const_var
New immutable variable that stores the value directly.
contextual_var
Create a contextualized variable.
response_done_var
New ResponseVar in the done state.
response_var
New paired ResponderVar and ResponseVar in the waiting state.
var
New read/write shared reference variable.
var_default
New read/write shared reference variable with default initial value.
var_derived
New read/write shared reference type-erased variable that has initial value derived from source.
var_from
New read/write shared reference variable from any type that can convert into it.
var_getter
Variable for getter properties (get_*, actual_*).
var_state
Variable for state properties (is_*, has_*).
weak_var
Weak variable that never upgrades.
weak_var_any
Weak variable that never upgrades.