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 optionallyU: 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.
- AnyVar
Hook Args - Arguments for
AnyVar::hook
. - AnyVar
Modify - Mutable reference to a variable value.
- AnyWhen
VarBuilder - Type erased
when_var!
manual builder. - ArcEq
- Arc value that implements equality by pointer comparison.
- BoxAny
VarValue - Small box for
AnyVarValue
values. - Context
Init Handle - Identifies the unique context a
contextual_var
is in. - Context
Var - Represents a named contextual variable.
- Merge
VarBuilder - Build a
merge_var!
from any number of input vars of the same typeI
. - Observable
Vec - Represents a
Vec<T>
that tracks changes when used inside a variable. - Responder
Var - Represents a read-write variable used to notify the completion of an async operation.
- Response
Var - 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.
- VarHook
Args - Arguments for
Var::hook
. - VarInstance
Tag - Unique identifier of a share variable, while it is alive.
- VarIs
Read Only Error - Error when an attempt to modify a variable without the
MODIFY
capability is made. - VarMerge
Inputs - Input arguments for the merge closure of
MergeVarBuilder
merge vars. - VarModify
- Mutable reference to a variable value.
- VarUpdate
Id - Represents the last time a variable was mutated or the current update cycle.
- Weak
AnyVar - Weak reference to a
AnyVar
. - Weak
Context Init Handle - Weak
ContextInitHandle
. - WeakVar
- Weak reference to a
Var<T>
. - When
VarBuilder - Manual
when_var!
builder.
Enums§
- Response
- Raw value in a
ResponseVar
. - VecChange
- Represents a change in a
ObservableVec
.
Traits§
- AnyVar
Value - Represents any variable value.
- Into
Value - 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
andResponseVar
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.