pub struct Node {
pub id: NodeId,
pub label: String,
pub kind: NodeKind,
pub target: Option<String>,
}Expand description
A node in the computational graph.
Fields§
§id: NodeId§label: String§kind: NodeKind§target: Option<String>Execution target: “local” (reserved, always local), or a worker tag. None means: use default (remote if workers available, else local).
Implementations§
Source§impl Node
impl Node
Sourcepub fn new(
id: impl Into<String>,
label: impl Into<String>,
filter_name: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, label: impl Into<String>, filter_name: impl Into<String>, ) -> Self
Create a filter node (backward-compatible with old 3-arg constructor).
Sourcepub fn filter_with_id(
id: impl Into<String>,
filter_name: impl Into<String>,
) -> Self
pub fn filter_with_id( id: impl Into<String>, filter_name: impl Into<String>, ) -> Self
Create a filter node with explicit id and filter_name.
Sourcepub fn filter(filter_name: impl Into<String>) -> Self
pub fn filter(filter_name: impl Into<String>) -> Self
Create a filter node where id defaults to filter_name.
Sourcepub fn loop_node(id: impl Into<String>, max_iterations: Option<usize>) -> Self
pub fn loop_node(id: impl Into<String>, max_iterations: Option<usize>) -> Self
Create a loop node.
Sourcepub fn with_target(self, target: impl Into<String>) -> Self
pub fn with_target(self, target: impl Into<String>) -> Self
Set the execution target for this node.
Sourcepub fn filter_name(&self) -> Option<&str>
pub fn filter_name(&self) -> Option<&str>
Get the filter name if this is a Filter node.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
Blanket Implementations§
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
Mutably borrows from an owned value. Read more