pub trait NodeWrapper: NodeClass {
type Payload: Copy + Default;
type Consumer: Copy + Hash;
type Producer: Copy + Hash;
// Provided methods
fn tick(&mut self) { ... }
fn read<IntoP>(&self, producer: IntoP) -> Self::Payload
where IntoP: Into<Self::Producer> { ... }
fn write<IntoC>(&mut self, consumer: IntoC, _input: Self::Payload)
where IntoC: Into<Self::Consumer> { ... }
}
Expand description
Wrapper around the internal representation of Node
.
This type abstracts all the nodes registered by the user. Its main
significance is that it is being returned from the graph when looking up
nodes. Read the Node
documentation to learn about its
usage.
§Example
ⓘ
let node_index = graph.add_node(Generator(1));
let node_wrapper = graph.node(&node_index).unwrap();
let data = node_wrapper.read(GeneratorProducer);
Required Associated Types§
Provided Methods§
fn tick(&mut self)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.