Function push_scope

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

pub fn push_scope(params: PushScopeParams<'_>) -> Result<ScopeHandle>

Push a new scope onto the active scope stack.

This creates a new ScopeHandle, emits a scope-start event to global and scope-local subscribers, and makes the new scope the current top of stack.

Parameters

  • name: Human-readable scope name recorded on emitted lifecycle events.
  • scope_type: Semantic category for the new scope.
  • parent: Optional explicit parent scope. When None, the current top of stack is used as the parent.
  • attributes: Bitflags that modify scope behavior and observability.
  • data: Optional application payload stored on the returned handle.
  • metadata: Optional JSON metadata recorded on the emitted start event.
  • input: Optional JSON payload exported as the Agent Trajectory Observability Format (ATOF) data payload.
  • timestamp: Optional timestamp recorded as the handle start time and on the emitted start event. When None, the current UTC time is used.

Returns

A Result containing the newly created ScopeHandle.

Errors

Returns an error when the runtime owner check fails or when internal state cannot be read safely.

Notes

The start event is queued with subscriber and sanitizer snapshots captured while the new scope is active.