Skip to main content

CscSnapshotGraph

Struct CscSnapshotGraph 

Source
pub struct CscSnapshotGraph<'view>(/* private fields */);
Expand description

Borrowed inbound adjacency (transpose-CSR / CSC layout).

§Performance

Per-node predecessor enumeration is O(k) for k incoming edges.

Implementations§

Source§

impl<'view> CscSnapshotGraph<'view>

Source

pub fn from_snapshot( snapshot: &Snapshot<'view>, ) -> Result<CscSnapshotGraph<'view>, CscSnapshotError>

Opens inbound sections from a validated Snapshot.

§Errors

Returns CscSnapshotError when sections are missing or fail validation.

§Performance

This function is O(s + n + m).

Source

pub fn from_snapshot_with_kinds( snapshot: &Snapshot<'view>, offsets_kind: u32, targets_kind: u32, ) -> Result<CscSnapshotGraph<'view>, CscSnapshotError>

Opens inbound sections using explicit snapshot section kinds.

§Errors

Returns CscSnapshotError when sections are missing or fail validation.

§Performance

This function is O(s + n + m).

Source

pub const fn inner( &self, ) -> &CsrGraph<'view, u32, u32, <u32 as CsrSnapshotIndex>::LittleEndianWord, <u32 as CsrSnapshotIndex>::LittleEndianWord>

Returns the inner CSR graph backing this inbound view.

Source

pub fn node_count(&self) -> usize

Returns the number of nodes in this inbound view.

§Performance

This method is O(1).

Source

pub fn relation_count(&self) -> usize

Returns the number of edges in this inbound view.

§Performance

This method is O(1).

Source

pub fn predecessors(&self, target: u32) -> 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.

Source

pub fn for_each_predecessor( &self, target: u32, visit: impl FnMut(u32) -> 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> Clone for CscSnapshotGraph<'view>

Source§

fn clone(&self) -> CscSnapshotGraph<'view>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'view> Debug for CscSnapshotGraph<'view>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl ElementPredecessors for CscSnapshotGraph<'_>

Source§

type Predecessors<'view> = CscPredecessors<'view> where CscSnapshotGraph<'_>: 'view

Iterator over predecessor element IDs reaching one element. Read more
Source§

fn element_predecessors( &self, element: CscNodeId, ) -> <CscSnapshotGraph<'_> as ElementPredecessors>::Predecessors<'_>

Returns elements that reach element through outgoing connections. Read more
Source§

impl TopologyBase for CscSnapshotGraph<'_>

Source§

type ElementId = CscNodeId

Identity of a topology element. Read more
Source§

type RelationId = CsrEdgeId<u32>

Identity of a topology relation. Read more
Source§

impl TopologyCounts for CscSnapshotGraph<'_>

Source§

fn element_count(&self) -> usize

Returns the number of elements visible in this topology view. Read more
Source§

fn relation_count(&self) -> usize

Returns the number of relations visible in this topology view. Read more
Source§

impl<'view> Copy for CscSnapshotGraph<'view>

Auto Trait Implementations§

§

impl<'view> Freeze for CscSnapshotGraph<'view>

§

impl<'view> RefUnwindSafe for CscSnapshotGraph<'view>

§

impl<'view> Send for CscSnapshotGraph<'view>

§

impl<'view> Sync for CscSnapshotGraph<'view>

§

impl<'view> Unpin for CscSnapshotGraph<'view>

§

impl<'view> UnsafeUnpin for CscSnapshotGraph<'view>

§

impl<'view> UnwindSafe for CscSnapshotGraph<'view>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> IncomingNeighborsGraph for T

Source§

type InNeighbors<'view> = <T as ElementPredecessors>::Predecessors<'view> where T: 'view

Iterator over nodes that have incoming edges to one target node.
Source§

fn incoming_neighbors( &self, node: <T as TopologyBase>::ElementId, ) -> <T as IncomingNeighborsGraph>::InNeighbors<'_>

Returns predecessor nodes with incoming edges to node.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> GraphBase for T
where T: TopologyBase,