Skip to main content

GraphConfig

Struct GraphConfig 

Source
pub struct GraphConfig {
    pub thread_id: Option<String>,
    pub trace_id: Option<String>,
    pub trace_ctx: Option<TraceCtx>,
    pub recursion_limit: usize,
    pub max_parallelism: usize,
    pub tags: Vec<String>,
    pub metadata: HashMap<String, Value>,
    pub configurable: HashMap<String, Value>,
}
Expand description

Runtime configuration for graph execution.

Fields§

§thread_id: Option<String>

Thread ID for checkpointing and state management

§trace_id: Option<String>

Trace ID for cross-crate correlation. If None, one is generated automatically at execution start.

§Phase status: compatibility / migration-only

This field uses String for backward compatibility. The canonical replacement is trace_ctx. Use trace_ctx() to obtain the canonical form.

Removal condition: removed when all callers migrate to trace_ctx.

§trace_ctx: Option<TraceCtx>

Canonical trace context for cross-crate correlation.

When set, takes precedence over the legacy trace_id field. If both are None, a new TraceCtx is generated at execution start.

§recursion_limit: usize

Maximum recursion depth (default: 100)

§max_parallelism: usize

Maximum number of parallel nodes in a single superstep. Hard-capped at 32. Default: 8.

§tags: Vec<String>

Tags for filtering and organization

§metadata: HashMap<String, Value>

Metadata attached to the execution

§configurable: HashMap<String, Value>

User-provided configurable values accessible by nodes

Implementations§

Source§

impl GraphConfig

Source

pub fn new() -> Self

Source

pub fn with_thread_id(self, id: impl Into<String>) -> Self

Source

pub fn with_recursion_limit(self, limit: usize) -> Self

Source

pub fn with_tag(self, tag: impl Into<String>) -> Self

Source

pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self

Source

pub fn with_configurable(self, key: impl Into<String>, value: Value) -> Self

Source

pub fn with_trace_id(self, id: impl Into<String>) -> Self

Source

pub fn with_max_parallelism(self, n: usize) -> Self

Source

pub fn resolve_trace_ctx(&self) -> TraceCtx

Resolve the canonical stack_ids::TraceCtx for this config.

Resolution order:

  1. self.trace_ctx if set (canonical path).
  2. self.trace_id converted via TraceCtx::from_legacy_trace_id (compat path).
  3. Generates a new TraceCtx if neither is set.
Source

pub fn with_trace_ctx(self, ctx: TraceCtx) -> Self

Set the canonical trace context.

Also back-fills the legacy trace_id field for compat consumers.

Trait Implementations§

Source§

impl Clone for GraphConfig

Source§

fn clone(&self) -> GraphConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GraphConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GraphConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for GraphConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for GraphConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more