pub struct CscSnapshotGraph<'view, N = u32, E = u32>(/* private fields */)
where
N: CsrSnapshotIndex,
E: CsrSnapshotIndex;Expand description
Borrowed inbound adjacency (transpose-CSR / CSC layout).
N is the node index width and E is the edge index width; both default to
u32 for the common engine configuration.
§Performance
Per-node predecessor enumeration is O(k) for k incoming edges.
Implementations§
Source§impl<'view, N, E> CscSnapshotGraph<'view, N, E>where
N: CsrSnapshotIndex,
E: CsrSnapshotIndex,
impl<'view, N, E> CscSnapshotGraph<'view, N, E>where
N: CsrSnapshotIndex,
E: CsrSnapshotIndex,
Sourcepub fn from_snapshot_with_kinds(
snapshot: &Snapshot<'view>,
offsets_kind: u32,
targets_kind: u32,
version: u32,
) -> Result<CscSnapshotGraph<'view, N, E>, CscSnapshotError<N, E>>
pub fn from_snapshot_with_kinds( snapshot: &Snapshot<'view>, offsets_kind: u32, targets_kind: u32, version: u32, ) -> Result<CscSnapshotGraph<'view, N, E>, CscSnapshotError<N, E>>
Opens inbound sections using explicit snapshot section kinds.
Reuses CsrGraph::from_snapshot_with_kinds over the transposed-edge
layout, so callers select whichever band their storage layer reserves
for the inbound index. CSC owns no section-kind constants.
§Errors
Returns CscSnapshotError when sections are missing, have the wrong
version, or fail validation.
§Performance
This function is O(s + n + m).
Sourcepub const fn inner(
&self,
) -> &CsrGraph<'view, N, E, <E as SnapshotWidth>::LittleEndianWord, <N as SnapshotWidth>::LittleEndianWord>
pub const fn inner( &self, ) -> &CsrGraph<'view, N, E, <E as SnapshotWidth>::LittleEndianWord, <N as SnapshotWidth>::LittleEndianWord>
Returns the inner CSR graph backing this inbound view.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Sourcepub fn relation_count(&self) -> usize
pub fn relation_count(&self) -> usize
Sourcepub fn predecessors(
&self,
target: LocalId<NodeAxis, N>,
) -> impl ExactSizeIterator
pub fn predecessors( &self, target: LocalId<NodeAxis, N>, ) -> impl ExactSizeIterator
Returns an iterator over predecessor node ids for target.
§Performance
This method is O(1) to create and O(k) to yield k predecessors.
Sourcepub fn for_each_predecessor(
&self,
target: LocalId<NodeAxis, N>,
visit: impl FnMut(LocalId<NodeAxis, N>) -> bool,
) -> bool
pub fn for_each_predecessor( &self, target: LocalId<NodeAxis, N>, visit: impl FnMut(LocalId<NodeAxis, N>) -> bool, ) -> bool
Walks predecessor node ids for target via the CSC source slice.
Stops early when visit returns true.
§Performance
This method is O(k) for k predecessors with no iterator adapters.
Trait Implementations§
Source§impl<'view, N, E> Clone for CscSnapshotGraph<'view, N, E>
impl<'view, N, E> Clone for CscSnapshotGraph<'view, N, E>
Source§fn clone(&self) -> CscSnapshotGraph<'view, N, E>
fn clone(&self) -> CscSnapshotGraph<'view, N, E>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<N, E> Debug for CscSnapshotGraph<'_, N, E>where
N: CsrSnapshotIndex,
E: CsrSnapshotIndex,
impl<N, E> Debug for CscSnapshotGraph<'_, N, E>where
N: CsrSnapshotIndex,
E: CsrSnapshotIndex,
Source§impl<N, E> ElementPredecessors for CscSnapshotGraph<'_, N, E>where
N: CsrSnapshotIndex,
E: CsrSnapshotIndex,
impl<N, E> ElementPredecessors for CscSnapshotGraph<'_, N, E>where
N: CsrSnapshotIndex,
E: CsrSnapshotIndex,
Source§type Predecessors<'view> = CscPredecessors<'view, N, E>
where
CscSnapshotGraph<'_, N, E>: 'view
type Predecessors<'view> = CscPredecessors<'view, N, E> where CscSnapshotGraph<'_, N, E>: 'view
Source§fn element_predecessors(
&self,
element: LocalId<NodeAxis, N>,
) -> <CscSnapshotGraph<'_, N, E> as ElementPredecessors>::Predecessors<'_>
fn element_predecessors( &self, element: LocalId<NodeAxis, N>, ) -> <CscSnapshotGraph<'_, N, E> as ElementPredecessors>::Predecessors<'_>
element through outgoing connections. Read moreSource§impl<N, E> TopologyBase for CscSnapshotGraph<'_, N, E>where
N: CsrSnapshotIndex,
E: CsrSnapshotIndex,
impl<N, E> TopologyBase for CscSnapshotGraph<'_, N, E>where
N: CsrSnapshotIndex,
E: CsrSnapshotIndex,
Source§impl<N, E> TopologyCounts for CscSnapshotGraph<'_, N, E>where
N: CsrSnapshotIndex,
E: CsrSnapshotIndex,
impl<N, E> TopologyCounts for CscSnapshotGraph<'_, N, E>where
N: CsrSnapshotIndex,
E: CsrSnapshotIndex,
Source§fn element_count(&self) -> usize
fn element_count(&self) -> usize
Source§fn relation_count(&self) -> usize
fn relation_count(&self) -> usize
impl<'view, N, E> Copy for CscSnapshotGraph<'view, N, E>
Auto Trait Implementations§
impl<'view, N, E> Freeze for CscSnapshotGraph<'view, N, E>where
N: Freeze,
impl<'view, N, E> RefUnwindSafe for CscSnapshotGraph<'view, N, E>where
N: RefUnwindSafe,
<E as SnapshotWidth>::LittleEndianWord: RefUnwindSafe,
<N as SnapshotWidth>::LittleEndianWord: RefUnwindSafe,
impl<'view, N, E> Send for CscSnapshotGraph<'view, N, E>where
N: Send,
<E as SnapshotWidth>::LittleEndianWord: Sync,
<N as SnapshotWidth>::LittleEndianWord: Sync,
impl<'view, N, E> Sync for CscSnapshotGraph<'view, N, E>where
N: Sync,
<E as SnapshotWidth>::LittleEndianWord: Sync,
<N as SnapshotWidth>::LittleEndianWord: Sync,
impl<'view, N, E> Unpin for CscSnapshotGraph<'view, N, E>where
N: Unpin,
impl<'view, N, E> UnsafeUnpin for CscSnapshotGraph<'view, N, E>where
N: UnsafeUnpin,
impl<'view, N, E> UnwindSafe for CscSnapshotGraph<'view, N, E>where
N: UnwindSafe,
<E as SnapshotWidth>::LittleEndianWord: RefUnwindSafe,
<N as SnapshotWidth>::LittleEndianWord: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DirectedVertexPredecessors for Twhere
T: ElementPredecessors,
impl<T> DirectedVertexPredecessors for Twhere
T: ElementPredecessors,
Source§type VertexPredecessors<'view> = <T as ElementPredecessors>::Predecessors<'view>
where
T: 'view
type VertexPredecessors<'view> = <T as ElementPredecessors>::Predecessors<'view> where T: 'view
Source§fn predecessor_vertices(
&self,
vertex: <T as TopologyBase>::ElementId,
) -> <T as DirectedVertexPredecessors>::VertexPredecessors<'_>
fn predecessor_vertices( &self, vertex: <T as TopologyBase>::ElementId, ) -> <T as DirectedVertexPredecessors>::VertexPredecessors<'_>
vertex.Source§impl<T> IncomingNeighborsGraph for Twhere
T: ElementPredecessors,
impl<T> IncomingNeighborsGraph for Twhere
T: ElementPredecessors,
Source§type InNeighbors<'view> = <T as ElementPredecessors>::Predecessors<'view>
where
T: 'view
type InNeighbors<'view> = <T as ElementPredecessors>::Predecessors<'view> where T: 'view
Source§fn incoming_neighbors(
&self,
node: <T as TopologyBase>::ElementId,
) -> <T as IncomingNeighborsGraph>::InNeighbors<'_>
fn incoming_neighbors( &self, node: <T as TopologyBase>::ElementId, ) -> <T as IncomingNeighborsGraph>::InNeighbors<'_>
node.