juncture_core/node/
mod.rs1mod into_node;
7mod r#trait;
8
9pub use into_node::{
10 IntoNode, NodeFnCommand, NodeFnCommandWithConfig, NodeFnCommandWithConfigAndRuntime,
11 NodeFnCommandWithRuntime, NodeFnUpdate, NodeFnUpdateWithConfig,
12 NodeFnUpdateWithConfigAndRuntime, NodeFnUpdateWithRuntime,
13};
14pub use r#trait::Node;
15
16#[derive(Debug)]
21pub struct NodeError<S: crate::State> {
22 pub node: String,
24
25 pub error: crate::JunctureError,
27
28 pub state: S,
30
31 pub attempt: u32,
33}
34
35impl<S: crate::State> std::fmt::Display for NodeError<S> {
36 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
37 write!(
38 f,
39 "Node '{}' failed on attempt {}: {}",
40 self.node, self.attempt, self.error
41 )
42 }
43}
44
45impl<S: crate::State> std::error::Error for NodeError<S> {
46 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
47 self.error.source()
48 }
49}
50
51