Struct calc_graph::Node

source ·
pub struct Node<C> { /* private fields */ }
Expand description

Represents a value within the graph.

Nodes can calculate their value automatically based on other nondes.

Implementations

Returns the node’s value, recalculating it if needed.

Wraps this node so that it can be used as an input to two or more dependent nodes.

Wraps this node so that its Calc type is hidden.

Boxing is needed when:

  • you need to write the type of the node, but you can’t write the name of the concrete Calc type (for instance, it’s a func node involving a closure)
  • you have a choice of types for a node (for instance, if a { a_node.boxed() } else { b_node.boxed() })

Returns the shared node’s value, recalculating it if needed.

Returns the const node’s value.

Returns the source node’s value.

Changes the value held within the source node based on the current value.

Replaces the value held within the source node.

Wraps the node with a function, whicih can inspect the node’s value each time it is calculated.

Returns a new node whose value is calculated from this node.

Returns a new node whose value is calculated from this node. The FnMut that performs the calculation can update the value in place.

Returns a new node whose value is calculated from this node and another node.

Returns a new node whose value is calculated from this node and another node. The FnMut that performs the calculation can update the value in place.

Returns a new node whose value is calculated from this node and 2 other nodes.

Returns a new node whose value is calculated from this node and 2 other nodes. The FnMut that performs the calculation can update the value in place.

Returns a new node whose value is calculated from this node and 3 other nodes.

Returns a new node whose value is calculated from this node and 3 other nodes. The FnMut that performs the calculation can update the value in place.

Returns a new node whose value is calculated from this node and 4 other nodes.

Returns a new node whose value is calculated from this node and 4 other nodes. The FnMut that performs the calculation can update the value in place.

Returns a new node whose value is calculated from this node and 5 other nodes.

Returns a new node whose value is calculated from this node and 5 other nodes. The FnMut that performs the calculation can update the value in place.

Returns a new node whose value is calculated from this node and 6 other nodes.

Returns a new node whose value is calculated from this node and 6 other nodes. The FnMut that performs the calculation can update the value in place.

Returns a new node whose value is calculated from this node and 7 other nodes.

Returns a new node whose value is calculated from this node and 7 other nodes. The FnMut that performs the calculation can update the value in place.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.