pub trait Edges: Sized {
// Required method
fn construct(resources: &mut TypeMap) -> Result<Self, GraphError>;
// Provided methods
fn reads() -> Vec<TypeKey> { ... }
fn writes() -> Vec<TypeKey> { ... }
fn moves() -> Vec<TypeKey> { ... }
}Expand description
Trait for describing types that are made up of graph edges (ie resources).
Graph edges are the resources that graph nodes (ie functions) consume.
The Edges trait allows the library user to construct types that use
resources. This is convenient when the number of resources becomes large
and using a tuple becomes unwieldy.
There exists a derive macro Edges to help implementing
this trait.
Required Methodsยง
Sourcefn construct(resources: &mut TypeMap) -> Result<Self, GraphError>
fn construct(resources: &mut TypeMap) -> Result<Self, GraphError>
Attempt to construct the implementor from the given TypeMap.
Provided Methodsยง
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.