Skip to main content

derive_whole

Function derive_whole 

Source
pub fn derive_whole(
    id: &str,
    registry: &CapabilityRegistry,
    index: &Index,
) -> Result<Graph, String>
Expand description

derive(), for a graph committed as data: Err when no such graph exists or when it stopped at MAX_NODES (whole).

use majordomus_cli::graph;
use majordomus_cli::synthetic::SyntheticRepository;

let repo = SyntheticRepository::small().unwrap();
let ctx = repo.context().unwrap();
assert!(graph::derive_whole("why", &ctx.registry, ctx.index.as_ref()).is_ok());
assert!(graph::derive_whole("no-such-graph", &ctx.registry, ctx.index.as_ref()).is_err());