Context class abstract

Constructors

Context()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
span Span
Get the Span attached to this Context, or an invalid, Span if no such Span exists.
no setter
spanContext SpanContext
Get the SpanContext from this Context, or an invalid SpanContext if no such SpanContext exists.
no setter

Methods

execute<R>(R fn()) → R
Execute a function fn within this Context and return its result.
getValue<T>(ContextKey key) → T?
Returns the value from this context identified by key, or null if no such value is set.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setValue(ContextKey key, Object value) Context
Returns a new context created from this one with the given key/value pair set.
toString() String
A string representation of this object.
inherited
withSpan(Span span) Context
Returns a new Context created from this one with the given Span set.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

current Context
The active context.
no setter
root Context
The root context which all other contexts are derived from.
no setter

Static Methods

createKey(String name) ContextKey
Returns a key to be used to read and/or write values to a context.