pub struct EdgeIndex { /* private fields */ }Expand description
Bidirectional edge index for efficient traversal
Implementations§
Source§impl EdgeIndex
impl EdgeIndex
pub fn new() -> Self
Sourcepub fn remove_edge(
&mut self,
source: &BlockId,
target: &BlockId,
edge_type: &EdgeType,
)
pub fn remove_edge( &mut self, source: &BlockId, target: &BlockId, edge_type: &EdgeType, )
Remove an edge from the index
Sourcepub fn remove_block(&mut self, block_id: &BlockId)
pub fn remove_block(&mut self, block_id: &BlockId)
Remove all edges involving a block
Sourcepub fn outgoing_from(&self, source: &BlockId) -> &[(EdgeType, BlockId)]
pub fn outgoing_from(&self, source: &BlockId) -> &[(EdgeType, BlockId)]
Get all outgoing edges from a block
Sourcepub fn incoming_to(&self, target: &BlockId) -> &[(EdgeType, BlockId)]
pub fn incoming_to(&self, target: &BlockId) -> &[(EdgeType, BlockId)]
Get all incoming edges to a block
Sourcepub fn outgoing_of_type(
&self,
source: &BlockId,
edge_type: &EdgeType,
) -> Vec<BlockId>
pub fn outgoing_of_type( &self, source: &BlockId, edge_type: &EdgeType, ) -> Vec<BlockId>
Get all edges of a specific type from a source
Sourcepub fn incoming_of_type(
&self,
target: &BlockId,
edge_type: &EdgeType,
) -> Vec<BlockId>
pub fn incoming_of_type( &self, target: &BlockId, edge_type: &EdgeType, ) -> Vec<BlockId>
Get all edges of a specific type to a target
Sourcepub fn has_edge(
&self,
source: &BlockId,
target: &BlockId,
edge_type: &EdgeType,
) -> bool
pub fn has_edge( &self, source: &BlockId, target: &BlockId, edge_type: &EdgeType, ) -> bool
Check if an edge exists
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get total edge count
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EdgeIndex
impl RefUnwindSafe for EdgeIndex
impl Send for EdgeIndex
impl Sync for EdgeIndex
impl Unpin for EdgeIndex
impl UnwindSafe for EdgeIndex
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