langgraph_core_rs/graph/
node.rs1use std::sync::Arc;
2use serde_json::Value as JsonValue;
3use crate::runnable::Runnable;
4use crate::types::RetryPolicy;
5
6#[derive(Clone)]
10pub struct StateNodeSpec {
11 pub name: String,
13 pub runnable: Arc<dyn Runnable>,
15 pub retry_policy: Option<RetryPolicy>,
17 pub metadata: Option<JsonValue>,
19 pub ends: Option<Vec<String>>,
22}
23
24impl StateNodeSpec {
25 pub fn new(name: impl Into<String>, runnable: Arc<dyn Runnable>) -> Self {
26 Self {
27 name: name.into(),
28 runnable,
29 retry_policy: None,
30 metadata: None,
31 ends: None,
32 }
33 }
34}