pub struct UndirectedEdge {
pub from: usize,
pub goto: usize,
}
Expand description
UndirectedEdge represents an bidirectional edge between two nodes.
§Examples
use graph_theory::GraphEngine;
Fields§
§from: usize
The index of the node that the edge is coming from, usually the smaller index.
goto: usize
The index of the node that the edge is going to, usually the larger index.
Implementations§
Source§impl UndirectedEdge
impl UndirectedEdge
Sourcepub fn new(from: usize, goto: usize) -> UndirectedEdge
pub fn new(from: usize, goto: usize) -> UndirectedEdge
Creates a new edge from the given indices (start from 0).
Source§impl UndirectedEdge
impl UndirectedEdge
Sourcepub fn as_unsupported<T>(&self) -> Result<T, GraphError>
pub fn as_unsupported<T>(&self) -> Result<T, GraphError>
Returns the edge as a directed edge, with the smaller index as the from
node.
Trait Implementations§
Source§impl Clone for UndirectedEdge
impl Clone for UndirectedEdge
Source§fn clone(&self) -> UndirectedEdge
fn clone(&self) -> UndirectedEdge
Returns a copy of the value. Read more
1.0.0 · 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 UndirectedEdge
impl Debug for UndirectedEdge
Source§impl Display for UndirectedEdge
impl Display for UndirectedEdge
Source§impl Edge for UndirectedEdge
impl Edge for UndirectedEdge
Source§fn direction(&self) -> EdgeDirection
fn direction(&self) -> EdgeDirection
Whether the edge is bidirectional Read more
Source§fn delta_index(&self) -> usize
fn delta_index(&self) -> usize
The smaller of the two indices. Read more
Source§impl From<UndirectedEdge> for EdgeQuery
impl From<UndirectedEdge> for EdgeQuery
Source§fn from(edge: UndirectedEdge) -> EdgeQuery
fn from(edge: UndirectedEdge) -> EdgeQuery
Converts to this type from the input type.
Source§impl PartialEq for UndirectedEdge
impl PartialEq for UndirectedEdge
impl Copy for UndirectedEdge
impl Eq for UndirectedEdge
impl StructuralPartialEq for UndirectedEdge
Auto Trait Implementations§
impl Freeze for UndirectedEdge
impl RefUnwindSafe for UndirectedEdge
impl Send for UndirectedEdge
impl Sync for UndirectedEdge
impl Unpin for UndirectedEdge
impl UnwindSafe for UndirectedEdge
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