pub struct NodeHandle { /* private fields */ }Expand description
Handle to a node for ergonomic port references
Implementations§
Source§impl NodeHandle
impl NodeHandle
pub fn id(&self) -> NodeId
Sourcepub fn from_module(id: NodeId, module: &dyn GraphModule) -> Self
pub fn from_module(id: NodeId, module: &dyn GraphModule) -> Self
Create a NodeHandle from a NodeId and module reference
Sourcepub fn output(&self, name: &str) -> Result<PortRef, PatchError>
pub fn output(&self, name: &str) -> Result<PortRef, PatchError>
Reference an output port by name, returning an error if it does not exist.
Prefer this over the panicking out when the port name comes from
untrusted or dynamic input (e.g. deserializing a patch). The error lists the valid
output ports for this module.
Sourcepub fn out(&self, name: &str) -> PortRef
pub fn out(&self, name: &str) -> PortRef
Reference an output port by name (panicking convenience).
Panics with a message listing the valid output ports if name is unknown. For a
non-panicking version use output.
Sourcepub fn in_(&self, name: &str) -> PortRef
pub fn in_(&self, name: &str) -> PortRef
Reference an input port by name (panicking convenience).
Panics with a message listing the valid input ports if name is unknown. For a
non-panicking version use input.
Sourcepub fn input_names(&self) -> Vec<&str>
pub fn input_names(&self) -> Vec<&str>
List the names of this module’s input ports (in spec order).
Sourcepub fn output_names(&self) -> Vec<&str>
pub fn output_names(&self) -> Vec<&str>
List the names of this module’s output ports (in spec order).
Trait Implementations§
Source§impl Clone for NodeHandle
impl Clone for NodeHandle
Source§fn clone(&self) -> NodeHandle
fn clone(&self) -> NodeHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more