pub struct NodeSpec {
pub id: String,
pub node_type: String,
pub params: HashMap<String, String>,
pub inputs: Vec<String>,
pub outputs: Vec<String>,
}Expand description
A simplified, serializable description of a graph node used by the optimization passes.
Fields§
§id: StringUnique node identifier.
node_type: StringNode type name (e.g. "Scale", "Brightness", "Contrast").
params: HashMap<String, String>Key/value parameters for the node.
inputs: Vec<String>IDs of nodes that feed into this node (predecessor IDs).
outputs: Vec<String>IDs of nodes that consume output from this node (successor IDs).
Implementations§
Source§impl NodeSpec
impl NodeSpec
Sourcepub fn new(id: impl Into<String>, node_type: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, node_type: impl Into<String>) -> Self
Create a minimal node spec.
Sourcepub fn with_param(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_param( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Builder helper: add a parameter.
Sourcepub fn with_inputs(self, inputs: Vec<String>) -> Self
pub fn with_inputs(self, inputs: Vec<String>) -> Self
Builder helper: set inputs.
Sourcepub fn with_outputs(self, outputs: Vec<String>) -> Self
pub fn with_outputs(self, outputs: Vec<String>) -> Self
Builder helper: set outputs.
Trait Implementations§
impl StructuralPartialEq for NodeSpec
Auto Trait Implementations§
impl Freeze for NodeSpec
impl RefUnwindSafe for NodeSpec
impl Send for NodeSpec
impl Sync for NodeSpec
impl Unpin for NodeSpec
impl UnsafeUnpin for NodeSpec
impl UnwindSafe for NodeSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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