pub trait LayoutIndex:
LayoutIndex
+ Copy
+ Eq
+ Ord
+ Debug
+ Display
+ Hash
+ Sized {
const ZERO: Self;
// Required methods
fn to_usize(self) -> Option<usize>;
fn from_usize(value: usize) -> Option<Self>;
}Expand description
Unsigned dense ID width usable by graph and hypergraph layouts and builders.
This is the single index-width contract for the whole substrate: it merges
what oxgraph-csr and oxgraph-hyper-bcsr previously duplicated as
CsrIndex/BcsrIndex. usize is included for native build-time indices;
persisted widths additionally implement SnapshotWidth.
§Performance
Implementations perform checked conversions in O(1).
Required Associated Constants§
Required Methods§
Sourcefn to_usize(self) -> Option<usize>
fn to_usize(self) -> Option<usize>
Converts this ID to usize when representable on the current target.
§Performance
This function is O(1).
Sourcefn from_usize(value: usize) -> Option<Self>
fn from_usize(value: usize) -> Option<Self>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".