#[non_exhaustive]pub enum GraphError {
Show 15 variants
EmptyGraph,
NodeNotFound(usize),
CycleDetected,
SubgraphCycle,
SubgraphNotFound(usize),
ArenaOom,
BuilderFailed,
ExceedsMaxNodes {
count: usize,
max: usize,
},
ExceedsMaxLevels {
depth: usize,
max: usize,
},
ExceedsMaxExtent {
extent: usize,
max: usize,
},
RenderPlanOom,
RenderCanvasTooSmall {
needed: usize,
got: usize,
},
RenderOutputTooSmall,
RenderWorkspaceTooSmall {
needed_bytes: usize,
got_bytes: usize,
},
RenderSinkFailed,
}Expand description
Unified error type for all graph and layout operations.
Each variant carries a WDP error code accessible via GraphError::code(),
and an actionable hint via GraphError::hint().
§WDP Code Mapping
| Variant | WDP Code | Meaning |
|---|---|---|
EmptyGraph | E.Graph.Node.001 | MISSING — no nodes |
NodeNotFound | E.Graph.Node.021 | NOT_FOUND — node absent |
CycleDetected | E.Graph.Dag.003 | INVALID — DAG constraint violated |
SubgraphCycle | E.Graph.Subgraph.003 | INVALID — nesting cycle |
SubgraphNotFound | E.Graph.Subgraph.021 | NOT_FOUND — subgraph absent |
ArenaOom | E.ArenaLayout.Alloc.026 | EXHAUSTED — arena memory |
BuilderFailed | E.ArenaLayout.Builder.026 | EXHAUSTED — builder alloc |
ExceedsMaxNodes | E.ArenaLayout.Node.004 | OVERFLOW — index type full |
ExceedsMaxLevels | E.ArenaLayout.Level.004 | OVERFLOW — too deep |
ExceedsMaxExtent | E.ArenaLayout.Extent.004 | OVERFLOW — canvas past the coordinate type |
RenderPlanOom | E.Render.Plan.026 | EXHAUSTED — plan buffer |
RenderCanvasTooSmall | E.Render.Canvas.026 | EXHAUSTED — band buffer |
RenderOutputTooSmall | E.Render.Sink.026 | EXHAUSTED — output buffer |
RenderWorkspaceTooSmall | E.Render.Workspace.026 | EXHAUSTED — composer workspace |
RenderSinkFailed | E.Render.Sink.032 | FAILED — caller’s writer errored |
§Examples
use ascii_dag::GraphError;
let err = GraphError::EmptyGraph;
assert_eq!(err.code(), "E.Graph.Node.001");
assert!(!err.hint().is_empty());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyGraph
The graph has no nodes.
WDP: E.Graph.Node.001 (MISSING)
NodeNotFound(usize)
A referenced node ID does not exist in the graph.
WDP: E.Graph.Node.021 (NOT_FOUND)
CycleDetected
The graph contains a cycle but acyclicity was required.
WDP: E.Graph.Dag.003 (INVALID)
SubgraphCycle
Subgraph nesting would create a cycle in the hierarchy.
WDP: E.Graph.Subgraph.003 (INVALID)
SubgraphNotFound(usize)
A referenced subgraph ID does not exist.
WDP: E.Graph.Subgraph.021 (NOT_FOUND)
ArenaOom
The arena allocator ran out of memory.
WDP: E.ArenaLayout.Alloc.026 (EXHAUSTED)
Use Graph::estimate_layout_arena_size() to compute the required size.
BuilderFailed
The IR builder failed to allocate output structures.
WDP: E.ArenaLayout.Builder.026 (EXHAUSTED)
ExceedsMaxNodes
The graph has more nodes or edges than the selected index type supports.
WDP: E.ArenaLayout.Node.004 (OVERFLOW)
Fields
ExceedsMaxLevels
The graph’s longest path exceeds the maximum level depth.
WDP: E.ArenaLayout.Level.004 (OVERFLOW)
ExceedsMaxExtent
The layout’s cross-axis extent — its packed nodes plus the cells port routing opens beside them — exceeds the arena coordinate type.
WDP: E.ArenaLayout.Extent.004 (OVERFLOW)
Fields
RenderPlanOom
The caller-provided render-plan buffer is too small.
WDP: E.Render.Plan.026 (EXHAUSTED)
Use estimate_render_arena_size() to compute the required size.
RenderCanvasTooSmall
The caller-provided band buffer holds fewer than
width × band_rows cells.
WDP: E.Render.Canvas.026 (EXHAUSTED)
RenderOutputTooSmall
The caller-provided output byte buffer filled up mid-render.
WDP: E.Render.Sink.026 (EXHAUSTED)
RenderWorkspaceTooSmall
A fixed composer workspace cannot hold this scene’s
composition. Units are BYTES — explicit in the field names so
they can never be confused with the cell counts of
RenderCanvasTooSmall.
WDP: E.Render.Workspace.026 (EXHAUSTED)
Fields
RenderSinkFailed
The caller’s fmt::Write sink reported an error mid-render.
The failure originated downstream of the renderer (the writer
itself); rendering state is unaffected and the render may be
retried with a healthy sink. Previously a writer failure could
only surface as a bare fmt::Error with no code.
WDP: E.Render.Sink.032 (FAILED)
Implementations§
Source§impl GraphError
impl GraphError
Trait Implementations§
Source§impl Clone for GraphError
impl Clone for GraphError
Source§fn clone(&self) -> GraphError
fn clone(&self) -> GraphError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GraphError
impl Debug for GraphError
Source§impl Display for GraphError
impl Display for GraphError
impl Eq for GraphError
Source§impl Error for GraphError
Available on crate feature std only.
impl Error for GraphError
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<GraphError> for ErrorChain
Available on crate feature alloc only.
impl From<GraphError> for ErrorChain
alloc only.