#[non_exhaustive]pub struct CustomNode {Show 20 fields
pub path: String,
pub source: NodeSource,
pub path_sha256: Option<String>,
pub args: Option<String>,
pub envs: Option<BTreeMap<String, EnvValue>>,
pub build: Option<String>,
pub send_stdout_as: Option<String>,
pub send_logs_as: Option<String>,
pub min_log_level: Option<String>,
pub max_log_size: Option<String>,
pub max_rotated_files: Option<u32>,
pub restart_policy: RestartPolicy,
pub max_restarts: u32,
pub restart_delay: Option<f64>,
pub max_restart_delay: Option<f64>,
pub restart_window: Option<f64>,
pub health_check_timeout: Option<f64>,
pub finish_grace_secs: Option<f64>,
pub run_config: NodeRunConfig,
pub startup_timeout: Option<f64>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.path: StringPath of the source code
If you want to use a specific conda environment.
Provide the python path within the source.
source: /home/peter/miniconda3/bin/python
args: some_node.py
Source can match any executable in PATH.
source: NodeSource§path_sha256: Option<String>SHA-256 the path download must match (set for hub binary artifacts,
spec §8.2). When present the daemon fetches path as a verified URL
download regardless of confinement — the checksum is the trust anchor.
args: Option<String>Args for the executable.
envs: Option<BTreeMap<String, EnvValue>>Environment variables injected during resolution.
Not user-writable: Node::env is the YAML surface. Resolution folds
it into this field, and the ROS2 bridge desugaring uses it to pass
DORA_ROS2_BRIDGE_CONFIG to the spawned bridge binary.
build: Option<String>§send_stdout_as: Option<String>Send stdout and stderr to another node
send_logs_as: Option<String>Redirect structured log entries to a data output as JSON strings
min_log_level: Option<String>Minimum log level for this node
max_log_size: Option<String>Maximum log file size before rotation (e.g. “50MB”, “1GB”)
max_rotated_files: Option<u32>Maximum number of rotated log files to keep (default: 5, range: 0-100)
0 keeps the active log only, rotating the previous one away.
restart_policy: RestartPolicy§max_restarts: u32Maximum number of restart attempts. 0 means unlimited.
restart_delay: Option<f64>Initial delay in seconds before restarting (exponential backoff).
max_restart_delay: Option<f64>Maximum delay in seconds for exponential backoff.
restart_window: Option<f64>Time window in seconds for counting restarts.
health_check_timeout: Option<f64>Health check timeout in seconds.
When set, the daemon monitors this node for activity once it has
connected (i.e. subscribed to events during Node::init). If the
connected node then does not communicate with the daemon within this
timeout, it is killed and the restart policy is evaluated.
This bounds post-connection liveness only, not startup time: a node still in a slow cold start has not connected yet and is never killed by this watchdog. A node that hangs before it ever subscribes is therefore not reaped here either.
finish_grace_secs: Option<f64>Per-node finish-drain grace period in seconds.
Overrides the global DORA_FINISH_DRAIN_GRACE_SECS for this node only.
run_config: NodeRunConfig§startup_timeout: Option<f64>Startup connection deadline in seconds.
If the node process fails to connect (subscribe to events) within this
many seconds after process spawn, the daemon kills the process and
evaluates the restart_policy.
Evaluated on each health_check_interval tick (default 5s).
Implementations§
Source§impl CustomNode
impl CustomNode
Sourcepub fn new(path: String) -> Self
pub fn new(path: String) -> Self
A local-source node at path with every other field left at its
default.
CustomNode is #[non_exhaustive], so other crates cannot build one
with a struct literal. Start here and assign the fields you need — they
are all still pub.
Sourcepub fn from_node(node: &mut Node, path: String) -> Self
pub fn from_node(node: &mut Node, path: String) -> Self
Move the custom-node keys out of node into a CustomNode at path.
Every key that all custom-node kinds resolve identically is taken from
node, leaving its Options empty and its collections cleared. What
stays behind are the node-level keys — id, name, description,
env, cpu_affinity, deploy — for ResolvedNode::from_node to
consume next, plus the kind-selection keys (git, hub, operators,
ros2, …) that classification has already read.
source and envs stay at their defaults: they are the two keys whose
value depends on the node kind, so the caller sets them — source from
classification for a path: node, envs for the ROS2 bridge, whose
path is its fixed binary.
This is a struct literal on purpose. CustomNode and NodeRunConfig
are #[non_exhaustive], so a literal only compiles here, inside the
defining crate — exactly where the compiler still insists that every
field is accounted for. A key added to either struct is a build error
on this line, not a descriptor key that parses and is then silently
dropped. dora-core’s every_custom_node_field_is_carried_through
checks the values on top.
Trait Implementations§
Source§impl Clone for CustomNode
impl Clone for CustomNode
Source§impl Debug for CustomNode
impl Debug for CustomNode
Source§impl<'de> Deserialize<'de> for CustomNode
impl<'de> Deserialize<'de> for CustomNode
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>,
Source§impl JsonSchema for CustomNode
impl JsonSchema for CustomNode
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for CustomNode
impl RefUnwindSafe for CustomNode
impl Send for CustomNode
impl Sync for CustomNode
impl Unpin for CustomNode
impl UnsafeUnpin for CustomNode
impl UnwindSafe for CustomNode
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more