ingraph 0.1.0

A declaration-driven indexing framework: records and nodes are written as Rust types, and the storage rows, the dataflow between them and the GraphQL query surface are emitted from the declaration.
Documentation
use super::{ArrangeError, CycleError, DirectFanoutError, EdgeEndpointError};
use crate::arrange::{EdgeId, NodeId};

// The three sentences a failed `validate` hands a person, asserted verbatim. They are the whole of
// what a refusal communicates — nothing in this crate matches on them and no accessor is reachable
// from a `Display` — so a rendering that lost a number, or read the wrong payload, would be
// invisible to every other test here.
#[test]
fn a_refusal_renders_the_facts_it_carries() {
  assert_eq!(
    ArrangeError::EdgeEndpointOutOfRange(EdgeEndpointError::new(EdgeId::new(2), NodeId::new(5), 3))
      .to_string(),
    "edge#2 endpoint node#5 is out of range; the graph declares 3 node(s)"
  );
  assert_eq!(
    ArrangeError::DirectFanout(DirectFanoutError::new(NodeId::new(1), "split".into(), 2))
      .to_string(),
    "node#1 (`split`) has 2 out-edges including a Direct edge; Direct must be exclusive"
  );
  assert_eq!(
    ArrangeError::Cycle(CycleError::new(NodeId::new(4), "loop".into())).to_string(),
    "graph cycle through node#4 (`loop`)"
  );
}