Crate zng_app_context
source ·Expand description
App execution context.
§Crate
This crate is part of the zng
project.
§Cargo Features
This crate provides 3 feature flags, 1 enabled by default.
§"multi_app"
Allows multiple app instances per-process.
This feature allows multiple apps, one app per thread at a time. The LocalContext
tracks
what app is currently running in each thread and app_local!
statics switch to the value of each app
depending on the current thread.
§"debug_default"
Enable "multi_app"
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.
Macros§
- Declares new app local variable.
- Declares new app and context local variable.
Structs§
- Identifies an app instance.
- An app local storage.
- Identifies an
AppLocal<T>
instance. - Represents an app lifetime, ends the app on drop.
- Represents an
AppLocal<T>
value that can be temporarily overridden in a context. - Identifies a selection of
LocalContext
values. - Tracks the current execution context.
- Represents a read guard for an
Arc<RwLock<T>>
that owns a reference to it, mapped from another read guard. - Represents a write guard for an
Arc<RwLock<T>>
that owns a reference to it, mapped from another read guard. - Read-only wrapper on an
Arc<RwLock<T>>
contextual value. - Helper, runs a cleanup action once on drop.
- Represents a read guard for an
Arc<RwLock<T>>
that owns a reference to it. - Represents a read guard for an
Arc<RwLock<T>>
that owns a reference to it. - Represents the
tracing::dispatcher::get_default
dispatcher in a context value set.
Enums§
- Defines a
LocalContext::capture_filtered
filter.
Traits§
- Provides an identifying key for a context local value.