Module depends::core

source ·

Structs

  • Wraps a dependency and tracks the hashed value each time it’s resolved. This allows the resolver to know if a dependency is ‘dirty’ from the perspective of the Dependee.
  • A node which has no dependencies. Leaf nodes receive their state from outside of the graph structure from calls to update.
  • Custom state for a LeafNode.
  • A wrapper for some data T, tracking some context around the data’s computation state.

Enums

  • Used to ensure that pending data is resolved at most once between calls to update.
  • A Hash of the current node state used to signal whether a dependent node needs to update its internal state.

Traits

  • For the majority of cases, this trait can be ignored, and a default implementation (no-op) can be used.
  • Enforces that a dependee type derived by the proc macro can only use a single type of dependency.
  • A unique number derived from the internal state of a node.
  • A unique integer value assigned to each node created in a particular runtime, allowing a Visitor to track visited nodes when resolving graphs.
  • For any dependee’s dependencies (or single Dependency), this is used to check whether previously observed values have changed, indicating its stored value needs to be recomputed.
  • A string name for each graph node, useful for rendering graph visualisations.
  • A Depth-first search resolver, used to recursively pass a Visitor through a graph, updating dependencies.
  • Describe how a Dependee updates its internal state when its dependencies change. As with UpdateLeaf, correct implementation of this involves a contract with the Clean trait.
  • Describe a Leaf node’s input, and how that mutates the internal state. Correct implentation of this trait requires that any temporary state tracked is cleared up when implementing Clean.
  • A collection passed in to a graph, tracking the identifiers of each nodes to avoid traversing

Type Definitions

  • Short-hand for the output read-reference of a node.