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§
- app_
local - Declares new app local variable.
- context_
local - Declares new app and context local variable.
Structs§
- AppId
- Identifies an app instance.
- AppLocal
- An app local storage.
- AppLocal
Id - Identifies an
AppLocal<T>
instance. - AppScope
- Represents an app lifetime, ends the app on drop.
- Context
Local - Represents an
AppLocal<T>
value that can be temporarily overridden in a context. - Context
Value Set - Identifies a selection of
LocalContext
values. - Local
Context - Tracks the current execution context.
- Mapped
RwLock Read Guard Owned - Represents a read guard for an
Arc<RwLock<T>>
that owns a reference to it, mapped from another read guard. - Mapped
RwLock Write Guard Owned - Represents a write guard for an
Arc<RwLock<T>>
that owns a reference to it, mapped from another read guard. - Read
Only RwLock - Read-only wrapper on an
Arc<RwLock<T>>
contextual value. - RunOn
Drop - Helper, runs a cleanup action once on drop.
- RwLock
Read Guard Owned - Represents a read guard for an
Arc<RwLock<T>>
that owns a reference to it. - RwLock
Write Guard Owned - Represents a read guard for an
Arc<RwLock<T>>
that owns a reference to it. - Tracing
Dispatcher Context - Represents the
tracing::dispatcher::get_default
dispatcher in a context value set.
Enums§
- Capture
Filter - Defines a
LocalContext::capture_filtered
filter.
Traits§
- Context
Local KeyProvider - Provides an identifying key for a context local value.