[go: up one dir, main page]

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 2 feature flags, 1 enabled by default.

§"debug_default"

Signal the build script to enable the "dyn_*" features in debug builds.

Enabled by default.

§"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.
types
Other variable types.

Macros§

context_var
Declares new ContextVar 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 with value made by merging multiple other variables.
when_var
Initializes a new conditional var.

Structs§

AnyVarHookArgs
Arguments for AnyVar::hook_any.
ArcEq
Arc value that implements equality by pointer comparison.
ArcVar
Reference counted read/write variable.
ContextInitHandle
Identifies the unique context a ContextualizedVar is in.
ContextVar
Represents another variable in a context.
LocalVar
Represents a single value as Var<T>.
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.
TraceValueArgs
Args for Var::trace_value.
VARS
Variable updates and animation service.
VARS_APP
VARS APP integration.
VarCapability
Kinds of interactions allowed by a Var<T> in the current update.
VarHandle
Handle to a variable hook.
VarHandles
Represents a collection of var handles.
VarHookArgs
Arguments for Var::hook.
VarIsReadOnlyError
Error when an attempt to modify a variable without the MODIFY capability is made.
VarModify
Represents the current value in a Var::modify handler.
VarPtr
Represents an AnyVar pointer that can be used for comparison.
VarUpdateId
Represents the last time a variable was mutated or the current update cycle.

Traits§

AnyVar
Methods of Var<T> that are object safe.
AnyVarValue
Trait implemented for all VarValue types.
AnyWeakVar
Represents a weak reference to an AnyVar.
IntoValue
A property value that is not a variable but can be inspected.
IntoVar
A value-to-var conversion that consumes the value.
Var
Represents an observable value.
VarValue
Represents a type that can be a Var<T> value.
WeakVar
Represents a weak reference to a Var<T>.

Functions§

getter_var
Variable for getter properties (get_*, actual_*).
response_done_var
New ResponseVar in the done state.
response_var
New paired ResponderVar and ResponseVar in the waiting state.
state_var
Variable for state properties (is_*, has_*).
var
New ref counted read/write variable with initial value.
var_default
New ref counted read/write variable with default initial value.
var_from
New ref counted read/write variable with initial value converted from source.

Type Aliases§

BoxedAnyVar
Represents a type erased boxed var.
BoxedAnyWeakVar
Represents a weak reference to a BoxedAnyVar.
BoxedVar
Represents a Var<T> boxed.
BoxedWeakVar
Represents a weak reference to a BoxedVar<T>.
ReadOnlyArcVar
Read-only ArcVar<T>.
ReadOnlyContextVar
Context var that is always read-only, even if it is representing a read-write var.
ResponderVar
Variable used to notify the completion of an async operation.
ResponseVar
Variable used to listen to a one time signal that an async operation has completed.