pub enum NodeState {
Initializing,
Ready,
Running,
Recovering {
reason: String,
details: Option<Value>,
},
Degraded {
reason: String,
},
Failed {
reason: String,
},
Stopped {
reason: StopReason,
},
}Expand description
Represents the runtime state of a node in the pipeline.
§State Machine
Nodes transition through these states during their lifecycle:
Initializing
↓
Ready ──────────┐
↓ │
Running ←──┐ │
↓ │ │
Recovering ──┘ │
↓ │
Degraded │
↓ │
Failed ←─────────┘
↓
Stopped§Valid Transitions:
Initializing→Ready(source nodes) orRunning(processing nodes)Ready→Running(when pipeline is ready)Running→Recovering(temporary issues, will retry)Running→Degraded(persistent issues, no retry)Running→Failed(fatal error)Running→Stopped(graceful shutdown)Recovering→Running(recovery succeeded)Recovering→Degraded(recovery partially succeeded, quality reduced)Recovering→Failed(recovery exhausted, giving up)Degraded→Failed(conditions worsened)Ready→Failed(initialization timeout or external failure)- Any state →
Stopped(external shutdown request)
Variants§
Initializing
Node is starting up and performing initialization. Examples: Opening connections, loading resources, validating configuration.
Ready
Node has completed initialization and is ready to process data. Source nodes (nodes with no inputs) wait in this state until all downstream nodes are also ready, preventing packet loss during pipeline startup. Non-source nodes typically skip this state and go directly to Running.
Running
Node is operating normally and processing data. This is the expected steady state for a healthy node.
Recovering
Node encountered an issue but is actively attempting to recover automatically. The node is still running but may not be processing data during recovery.
Examples:
- Transport node reconnecting after connection loss
- Decoder resyncing after corrupted data
- Node waiting for stalled input to resume
The reason field provides a human-readable explanation.
The optional details field can contain node-specific structured information
(e.g., retry attempt numbers, affected resources).
Degraded
Node is operational but experiencing persistent issues that affect quality or performance.
Unlike Recovering, the node is not actively attempting automatic recovery.
Examples:
- High latency or packet loss in transport
- Resource constraints (CPU, memory pressure)
- Partial functionality (some features unavailable)
The node continues processing but users should be aware of reduced quality.
Failed
Node has encountered a fatal error and stopped processing. Manual intervention is required to restart the node.
Examples:
- Max reconnection attempts exhausted
- Invalid configuration detected at runtime
- Unrecoverable protocol error
Stopped
Node has stopped processing and shut down.
The reason field indicates why the node stopped:
- “completed” - Expected end of finite data stream (stateless pipelines)
- “input_closed” - Upstream node closed, no more data to process
- “shutdown” - Graceful shutdown was requested
In live/dynamic pipelines, this state often indicates an issue (unexpected stop). In stateless pipelines, “completed” is the expected end state.
Fields
reason: StopReasonTrait Implementations§
Source§impl<'de> Deserialize<'de> for NodeState
impl<'de> Deserialize<'de> for NodeState
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodeState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodeState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for NodeState
impl Serialize for NodeState
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl TS for NodeState
impl TS for NodeState
Source§type WithoutGenerics = NodeState
type WithoutGenerics = NodeState
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or ().
The only requirement for these dummy types is that EXPORT_TO must be None. Read moreSource§type OptionInnerType = NodeState
type OptionInnerType = NodeState
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete() -> String
fn decl_concrete() -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl() -> String
fn decl() -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline() -> String
fn inline() -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened() -> String
fn inline_flattened() -> String
This function will panic if the type cannot be flattened.
Source§fn visit_generics(v: &mut impl TypeVisitor)where
NodeState: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
NodeState: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported.The returned path does not include the base directory from
TS_RS_EXPORT_DIR. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
NodeState: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
NodeState: 'static,
Source§fn dependencies() -> Vec<Dependency>where
Self: 'static,
fn dependencies() -> Vec<Dependency>where
Self: 'static,
Source§fn export() -> Result<(), ExportError>where
Self: 'static,
fn export() -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all() -> Result<(), ExportError>where
Self: 'static,
fn export_all() -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read moreSource§fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read more