Initializersliemeobn.elementary 0.5.0Elementary
init(_:)
Creates an environment property that reads the value from the given TaskLocal
.
init(_ taskLocal: TaskLocal<T>)
Parameters
- taskLocal
The
TaskLocal
to read the value from.
Creates an environment property that reads the value from the given TaskLocal
.
init(_ taskLocal: TaskLocal<T>)
s10Elementary11EnvironmentVyACyxG12_Concurrency9TaskLocalCyxGcfc
What are these?5JJO5
The TaskLocal
to read the value from.
import Elementary
@propertyWrapper struct Environment<T> where T : Sendable
A property wrapper that reads an environment value from a TaskLocal
.
final class TaskLocal<Value> where Value : Sendable
Wrapper type that defines a task-local value key.
init(requiring taskLocal: TaskLocal<T?>)
Creates an environment property that reads the value from the given TaskLocal
by force-unwrapping an optional.
var wrappedValue: T { get }
The value of the environment property.