Values

A Value is a stateful unit of data held within a dependency graph node. During execution, values will be prompted to recalculate their state if their dependencies change their values.

A Value is required to declare how it can be:

  • Hashed: Provide a single unique integer for its state (or indicate it can't be hashed).
  • Cleaned: Declare how to clean any transient state.

Use the #[derive(Value)] macro to make a struct compatible with the dependency graph.

use depends::derives::Value;

#[derive(Value, Hash)]
struct YourStruct {
    // ... your fields go here
}

The default behaviour of this type is to:

  • Hash all fields.
  • Not clean any transient state.