pub struct DrainageGraph { /* private fields */ }Expand description
The complete upstream adjacency graph over catchment atoms.
This is the canonical in-memory representation of graph.arrow for
validation and construction purposes. The HashMap-based index provides
O(1) lookup by atom ID.
Note for engine implementors: this representation is optimized for validation and random access, not traversal. A delineation engine will typically convert to CSR (compressed sparse row) or another traversal-optimized layout at load time, as permitted by the HFX spec.
Implementations§
Source§impl DrainageGraph
impl DrainageGraph
Sourcepub fn new(rows: Vec<AdjacencyRow>) -> Result<Self, GraphError>
pub fn new(rows: Vec<AdjacencyRow>) -> Result<Self, GraphError>
Construct a DrainageGraph from a vector of AdjacencyRows.
Builds the internal O(1) lookup index as part of construction.
§Errors
| Condition | Error variant |
|---|---|
rows is empty | GraphError::EmptyGraph |
The same AtomId appears in two or more rows | GraphError::DuplicateAtomId |
Sourcepub fn rows(&self) -> &[AdjacencyRow]
pub fn rows(&self) -> &[AdjacencyRow]
Return all rows in the graph.
Trait Implementations§
Source§impl Clone for DrainageGraph
impl Clone for DrainageGraph
Source§fn clone(&self) -> DrainageGraph
fn clone(&self) -> DrainageGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DrainageGraph
impl Debug for DrainageGraph
Source§impl PartialEq for DrainageGraph
impl PartialEq for DrainageGraph
impl StructuralPartialEq for DrainageGraph
Auto Trait Implementations§
impl Freeze for DrainageGraph
impl RefUnwindSafe for DrainageGraph
impl Send for DrainageGraph
impl Sync for DrainageGraph
impl Unpin for DrainageGraph
impl UnsafeUnpin for DrainageGraph
impl UnwindSafe for DrainageGraph
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