pub struct EdgeIdManager<'a> { /* private fields */ }Expand description
Edge ID manager for allocating and managing edge identifiers
Implementations§
Source§impl<'a> EdgeIdManager<'a>
impl<'a> EdgeIdManager<'a>
Sourcepub fn max_edge_id(&self) -> NativeEdgeId
pub fn max_edge_id(&self) -> NativeEdgeId
Get the maximum valid edge ID
Returns the highest edge ID that has been allocated.
§Returns
The maximum edge ID as a NativeEdgeId
Sourcepub fn allocate_edge_id(&mut self) -> NativeEdgeId
pub fn allocate_edge_id(&mut self) -> NativeEdgeId
Sourcepub fn validate_edge_id(&self, edge_id: NativeEdgeId) -> NativeResult<()>
pub fn validate_edge_id(&self, edge_id: NativeEdgeId) -> NativeResult<()>
Sourcepub fn edge_count(&self) -> u64
pub fn edge_count(&self) -> u64
Sourcepub unsafe fn reset_edge_ids(&mut self)
pub unsafe fn reset_edge_ids(&mut self)
Reset all edge IDs (for testing only)
This function resets the edge ID counter to zero. It should only be used in test environments with caution.
§Safety
This will invalidate all existing edge IDs and should only be used in controlled test scenarios.
Source§impl<'a> EdgeIdManager<'a>
impl<'a> EdgeIdManager<'a>
Sourcepub fn get_statistics(&self) -> EdgeStatistics
pub fn get_statistics(&self) -> EdgeStatistics
Sourcepub fn is_efficient_utilization(&self) -> bool
pub fn is_efficient_utilization(&self) -> bool
Check if edge IDs are efficiently utilized
Returns true if the ratio of allocated IDs to total edges is reasonable. This helps detect potential gaps in ID allocation.
§Returns
true if ID utilization is efficient (>= 80%), false otherwise
Sourcepub fn calculate_fragmentation(&self) -> f64
pub fn calculate_fragmentation(&self) -> f64
Calculate edge ID fragmentation
Returns the percentage of unused edge IDs within the allocated range.
§Returns
Fragmentation percentage (0.0 to 1.0)