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§

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.
AppLocalId
Identifies an AppLocal<T> instance.
AppScope
Represents an app lifetime, ends the app on drop.
ContextLocal
Represents an AppLocal<T> value that can be temporarily overridden in a context.
ContextValueSet
Identifies a selection of LocalContext values.
LocalContext
Tracks the current execution context.
MappedRwLockReadGuardOwned
Represents a read guard for an Arc<RwLock<T>> that owns a reference to it, mapped from another read guard.
MappedRwLockWriteGuardOwned
Represents a write guard for an Arc<RwLock<T>> that owns a reference to it, mapped from another read guard.
ReadOnlyRwLock
Read-only wrapper on an Arc<RwLock<T>> contextual value.
RunOnDrop
Helper, runs a cleanup action once on drop.
RwLockReadGuardOwned
Represents a read guard for an Arc<RwLock<T>> that owns a reference to it.
RwLockWriteGuardOwned
Represents a read guard for an Arc<RwLock<T>> that owns a reference to it.
TracingDispatcherContext
Represents the tracing::dispatcher::get_default dispatcher in a context value set.

Enums§

CaptureFilter
Defines a LocalContext::capture_filtered filter.

Traits§

ContextLocalKeyProvider
Provides an identifying key for a context local value.