Skip to main content

CustomNode

Struct CustomNode 

Source
#[non_exhaustive]
pub struct CustomNode {
Show 19 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,
}

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§path: String

Path 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: u32

Maximum 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

Implementations§

Source§

impl CustomNode

Source

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.

Source

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

Source§

fn clone(&self) -> CustomNode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CustomNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CustomNode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for CustomNode

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for CustomNode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V