Context class
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 api.Span
set.
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.