pub struct Config {
pub thread_id: Option<String>,
pub checkpoint_id: Option<String>,
pub recursion_limit: usize,
pub metadata: HashMap<String, Value>,
pub tags: Vec<String>,
}Expand description
Configuration for graph execution.
Config controls various aspects of graph execution including which checkpoint to load, recursion limits, and custom metadata.
§Example
use rust_langgraph::Config;
let config = Config::new()
.with_thread_id("user-123")
.with_recursion_limit(100)
.with_metadata("user_name", "Alice");Fields§
§thread_id: Option<String>Thread ID for checkpoint isolation
checkpoint_id: Option<String>Specific checkpoint ID to load (for time travel)
recursion_limit: usizeMaximum recursion depth before error
metadata: HashMap<String, Value>Custom metadata
Tags for categorizing runs
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_thread_id(self, thread_id: impl Into<String>) -> Self
pub fn with_thread_id(self, thread_id: impl Into<String>) -> Self
Set the thread ID for checkpoint isolation
Sourcepub fn with_checkpoint_id(self, checkpoint_id: impl Into<String>) -> Self
pub fn with_checkpoint_id(self, checkpoint_id: impl Into<String>) -> Self
Set a specific checkpoint ID to load (for time travel)
Sourcepub fn with_recursion_limit(self, limit: usize) -> Self
pub fn with_recursion_limit(self, limit: usize) -> Self
Set the recursion limit
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<Value>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<Value>, ) -> Self
Add metadata
Sourcepub fn ensure_thread_id(&mut self) -> &str
pub fn ensure_thread_id(&mut self) -> &str
Get or create a thread ID
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more