pub struct TaskGraph {
pub nodes: BTreeSet<TaskId>,
pub edges: BTreeSet<Edge>,
}Expand description
The validated task graph of a workspace.
§Examples
use std::collections::BTreeSet;
use std::str::FromStr;
use haz_dag::edge::{Edge, EdgeKind};
use haz_dag::graph::TaskGraph;
use haz_domain::name::{ProjectName, TaskName};
use haz_domain::task_id::TaskId;
let a = TaskId {
project: ProjectName::from_str("p").unwrap(),
task: TaskName::from_str("a").unwrap(),
};
let b = TaskId {
project: ProjectName::from_str("p").unwrap(),
task: TaskName::from_str("b").unwrap(),
};
let graph = TaskGraph {
nodes: BTreeSet::from([a.clone(), b.clone()]),
edges: BTreeSet::from([Edge {
from: a,
to: b,
kind: EdgeKind::Hard,
}]),
};
assert_eq!(graph.nodes.len(), 2);
assert_eq!(graph.edges.len(), 1);Fields§
§nodes: BTreeSet<TaskId>Every task that participates in the graph, by identity.
edges: BTreeSet<Edge>Every edge in the graph, tagged by crate::edge::EdgeKind.
Trait Implementations§
impl Eq for TaskGraph
impl StructuralPartialEq for TaskGraph
Auto Trait Implementations§
impl Freeze for TaskGraph
impl RefUnwindSafe for TaskGraph
impl Send for TaskGraph
impl Sync for TaskGraph
impl Unpin for TaskGraph
impl UnsafeUnpin for TaskGraph
impl UnwindSafe for TaskGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more