Trait IntoNode
Source pub trait IntoNode {
// Required method
fn into_node(self, ctx: &mut Context) -> Result<Node, Error>;
}
Expand description
Helper trait for things that can be converted into a Node
given a
Context
.
This trait allows you to write
let x = ctx.x();
let sum = ctx.add(x, 1.0).unwrap();
instead of the more verbose
let x = ctx.x();
let num = ctx.constant(1.0);
let sum = ctx.add(x, num).unwrap();
Converts the given values into a node