pub struct UndirectedTopology { /* private fields */ }Implementations§
Source§impl UndirectedTopology
impl UndirectedTopology
Sourcepub fn try_from_edges(
node_count: usize,
edges: impl IntoIterator<Item = EdgeEndpoints>,
) -> Result<Self>
pub fn try_from_edges( node_count: usize, edges: impl IntoIterator<Item = EdgeEndpoints>, ) -> Result<Self>
Builds an undirected topology with compact incidence CSR.
Self-loops occupy one incidence entry and report degree two.
§Errors
Returns an error for capacity overflow or an endpoint outside the graph.
pub const fn node_count(&self) -> usize
pub const fn edge_count(&self) -> usize
pub fn contains_node(&self, node: NodeIndex) -> bool
pub fn contains_edge(&self, edge: EdgeIndex) -> bool
pub fn edge_endpoints(&self, edge: EdgeIndex) -> Option<EdgeEndpoints>
pub fn incident_edges( &self, node: NodeIndex, ) -> impl DoubleEndedIterator<Item = EdgeIndex> + ExactSizeIterator + '_
pub fn incident_edge_at( &self, node: NodeIndex, offset: usize, ) -> Option<EdgeIndex>
pub fn neighbors( &self, node: NodeIndex, ) -> impl DoubleEndedIterator<Item = NodeIndex> + ExactSizeIterator + '_
pub fn degree(&self, node: NodeIndex) -> Option<usize>
Trait Implementations§
Source§impl Clone for UndirectedTopology
impl Clone for UndirectedTopology
Source§fn clone(&self) -> UndirectedTopology
fn clone(&self) -> UndirectedTopology
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UndirectedTopology
impl Debug for UndirectedTopology
Source§impl<'de> Deserialize<'de> for UndirectedTopology
impl<'de> Deserialize<'de> for UndirectedTopology
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for UndirectedTopology
Source§impl PartialEq for UndirectedTopology
impl PartialEq for UndirectedTopology
Source§impl Serialize for UndirectedTopology
impl Serialize for UndirectedTopology
impl StructuralPartialEq for UndirectedTopology
Source§impl UndirectedGraphView for UndirectedTopology
impl UndirectedGraphView for UndirectedTopology
type Node = NodeIndex
type Edge = EdgeIndex
fn node_count(&self) -> usize
fn edge_count(&self) -> usize
fn contains_node(&self, node: NodeIndex) -> bool
fn contains_edge(&self, edge: EdgeIndex) -> bool
fn node_indices(&self) -> impl Iterator<Item = NodeIndex> + '_
fn edge_indices(&self) -> impl Iterator<Item = EdgeIndex> + '_
fn edge_endpoints(&self, edge: EdgeIndex) -> Option<EdgeEndpoints>
fn incident_edges( &self, node: NodeIndex, ) -> impl DoubleEndedIterator<Item = EdgeIndex> + ExactSizeIterator + '_
fn opposite(&self, edge: Self::Edge, node: Self::Node) -> Option<Self::Node>
Auto Trait Implementations§
impl Freeze for UndirectedTopology
impl RefUnwindSafe for UndirectedTopology
impl Send for UndirectedTopology
impl Sync for UndirectedTopology
impl Unpin for UndirectedTopology
impl UnsafeUnpin for UndirectedTopology
impl UnwindSafe for UndirectedTopology
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