NodeIo

Struct NodeIo 

Source
pub struct NodeIo<'a> { /* private fields */ }
Expand description

Minimal node I/O surface backed by executor queues.

use daedalus_runtime::io::NodeIo;
use daedalus_runtime::executor::EdgePayload;

fn handler(io: &mut NodeIo) {
    io.push_output(Some("out"), EdgePayload::Unit);
}

Implementations§

Source§

impl<'a> NodeIo<'a>

Source

pub fn new( incoming_edges: Vec<usize>, outgoing_edges: Vec<usize>, queues: &'a Arc<Vec<EdgeStorage>>, warnings_seen: &'a Arc<Mutex<HashSet<String>>>, edges: &'a [(NodeRef, String, NodeRef, String, EdgePolicyKind)], sync_groups: Vec<SyncGroup>, seg_idx: usize, node_idx: usize, node_id: String, telemetry: &'a mut ExecutionTelemetry, backpressure: BackpressureStrategy, const_inputs: &[(String, Value)], const_coercers: Option<ConstCoercerMap>, output_movers: Option<OutputMoverMap>, ) -> Self

Construct the I/O facade for a node (internal runtime API).

Source

pub fn inputs(&self) -> &[(String, CorrelatedPayload)]

Returns the consumed inputs for this node. Borrow the drained inputs.

use daedalus_runtime::io::NodeIo;
fn handler(io: &NodeIo) {
    let _ = io.inputs();
}
Source

pub fn has_incoming_edges(&self) -> bool

Whether this node has any incoming edges.

Source

pub fn sync_groups(&self) -> &[SyncGroup]

Returns sync groups metadata for this node. Return sync group metadata.

use daedalus_runtime::io::NodeIo;
fn handler(io: &NodeIo) {
    let _ = io.sync_groups();
}
Source

pub fn push_output(&mut self, port: Option<&str>, payload: EdgePayload)

Push a payload to all outgoing edges (fan-out). Optionally filter by port. Push a prepared payload to an output port.

use daedalus_runtime::io::NodeIo;
use daedalus_runtime::executor::EdgePayload;
fn handler(io: &mut NodeIo) {
    io.push_output(Some("out"), EdgePayload::Unit);
}
Source

pub fn push_correlated_payload( &mut self, port: Option<&str>, correlated: CorrelatedPayload, )

Push a pre-correlated payload (used by host-bridge style nodes).

Source

pub fn push_any<T: Any + Send + Sync + 'static>( &mut self, port: Option<&str>, value: T, )

Source

pub fn push_typed<T>(&mut self, port: Option<&str>, value: T)
where T: Any + Clone + Send + Sync + 'static,

Source

pub fn push_value(&mut self, port: Option<&str>, value: Value)

Push a Value payload to an output port.

use daedalus_runtime::io::NodeIo;
use daedalus_data::model::Value;
fn handler(io: &mut NodeIo) {
    io.push_value(Some("out"), Value::Int(1));
}
Source

pub fn inputs_for<'b>( &'b self, port: &str, ) -> impl Iterator<Item = &'b CorrelatedPayload>

Iterate all inputs for a given port name. Iterate inputs for a named port.

use daedalus_runtime::io::NodeIo;
fn handler(io: &NodeIo) {
    for _payload in io.inputs_for("in") {}
}
Source

pub fn get_any<T: Any + Clone + Send + Sync>(&self, port: &str) -> Option<T>

Typed accessor for Any payloads.

Source

pub fn get_any_ref<T: Any + Send + Sync>(&self, port: &str) -> Option<&T>

Borrow a typed Any payload without cloning.

Source

pub fn get_typed_ref<T>(&self, port: &str) -> Option<&T>
where T: Any + Clone + Send + Sync,

Borrow a typed input with constant coercion support.

Source

pub fn get_any_mut<T>(&mut self, port: &str) -> Option<T>
where T: Any + Clone + Send + Sync,

Move a typed Any payload, cloning only when shared.

Source

pub fn get_typed_mut<T>(&mut self, port: &str) -> Option<T>
where T: Any + Clone + Send + Sync,

Move a typed input with constant coercion support, cloning only when shared.

Source

pub fn get_any_all<T: Any + Clone + Send + Sync>(&self, port: &str) -> Vec<T>

Collect all typed Any payloads for a port (in arrival order).

Source

pub fn get_any_all_fanin<T: Any + Clone + Send + Sync>( &self, prefix: &str, ) -> Vec<T>

Collect typed Any payloads for indexed fan-in ports {prefix}{N} ordered by N.

Example: prefix="in" collects from in0, in1, … in numeric order.

Source

pub fn get_any_all_fanin_indexed<T: Any + Clone + Send + Sync>( &self, prefix: &str, ) -> Vec<(u32, T)>

Collect typed Any payloads for indexed fan-in ports {prefix}{N} ordered by N, preserving the parsed index.

Source

pub fn get_typed<T>(&self, port: &str) -> Option<T>
where T: Any + Clone + Send + Sync,

Best-effort typed accessor that supports constant defaults.

Daedalus graph JSON encodes constant inputs as daedalus_data::model::Value. At runtime we inject these into the node as Any payloads (e.g. i64, f64, bool, String, or Value). This helper bridges the gap so node handlers can request their native types (e.g. u32, f32, enums) without failing a TypeId downcast.

This is intended for scalar/enum config inputs, not large payload types (e.g. image buffers).

Source

pub fn get_any_raw(&self, port: &str) -> Option<&dyn Any>

Get a raw Any reference for capability-based dispatch.

Source

pub fn get_value(&self, port: &str) -> Option<&Value>

Convenience accessor for value payloads. Get a structured Value payload for a port.

use daedalus_runtime::io::NodeIo;
fn handler(io: &NodeIo) {
    let _ = io.get_value("in");
}
Source

pub fn get_int(&self, port: &str) -> Option<i64>

Source

pub fn get_float(&self, port: &str) -> Option<f64>

Source

pub fn inputs_grouped(&self) -> Vec<(String, Vec<&CorrelatedPayload>)>

Group inputs by port name (preserves encounter order per port).

Source

pub fn flush(&mut self) -> Result<(), ExecuteError>

Flush is a no-op now since we apply immediately; kept for symmetry.

Auto Trait Implementations§

§

impl<'a> !Freeze for NodeIo<'a>

§

impl<'a> !RefUnwindSafe for NodeIo<'a>

§

impl<'a> Send for NodeIo<'a>

§

impl<'a> !Sync for NodeIo<'a>

§

impl<'a> Unpin for NodeIo<'a>

§

impl<'a> !UnwindSafe for NodeIo<'a>

Blanket Implementations§

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<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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.