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<Self, CscSnapshotError<N, E>>
pub fn from_snapshot_with_kinds( snapshot: &Snapshot<'view>, offsets_kind: u32, targets_kind: u32, version: u32, ) -> Result<Self, 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) -> &CscInnerGraph<'view, N, E>
pub const fn inner(&self) -> &CscInnerGraph<'view, N, E>
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: CscNodeId<N>,
) -> impl ExactSizeIterator<Item = CscNodeId<N>> + '_
pub fn predecessors( &self, target: CscNodeId<N>, ) -> impl ExactSizeIterator<Item = CscNodeId<N>> + '_
Returns an iterator over predecessor node ids for target.
§Performance
This method is O(1) to create and O(k) to yield k predecessors.
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 moreimpl<'view, N, E> Copy for CscSnapshotGraph<'view, N, E>
Source§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
Self: 'view
type Predecessors<'view> = CscPredecessors<'view, N, E> where Self: 'view
Source§fn element_predecessors(&self, element: CscNodeId<N>) -> Self::Predecessors<'_>
fn element_predecessors(&self, element: CscNodeId<N>) -> Self::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
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,
impl<T> GraphBase for Twhere
T: TopologyBase,
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.