pub struct DiGraph<L = ()> { /* private fields */ }Expand description
Directed graph.
Implementations§
Source§impl<L: Copy> DiGraph<L>
impl<L: Copy> DiGraph<L>
Sourcepub fn copied_labels(&self, vertices: impl AsRef<[VertexId]>) -> Vec<L>
pub fn copied_labels(&self, vertices: impl AsRef<[VertexId]>) -> Vec<L>
Copies and returns all labels associated with the given vertices.
Source§impl<L: Clone> DiGraph<L>
impl<L: Clone> DiGraph<L>
Sourcepub fn cloned_labels(&self, vertices: impl AsRef<[VertexId]>) -> Vec<L>
pub fn cloned_labels(&self, vertices: impl AsRef<[VertexId]>) -> Vec<L>
Clones and returns all labels associated with the given vertices.
Source§impl<L> DiGraph<L>
impl<L> DiGraph<L>
Sourcepub fn add_edge(&mut self, source: VertexId, sink: VertexId) -> bool
pub fn add_edge(&mut self, source: VertexId, sink: VertexId) -> bool
Creates a directed edge between vertices.
Sourcepub fn labels(&self, vertices: &[VertexId]) -> impl Iterator<Item = &L>
pub fn labels(&self, vertices: &[VertexId]) -> impl Iterator<Item = &L>
Returns iterator over labels for given vertices.
Sourcepub fn is_acyclic(&self) -> bool
pub fn is_acyclic(&self) -> bool
Returns true when a graph is acyclic.
Trait Implementations§
Source§impl<L> LabeledVertex<L> for DiGraph<L>
impl<L> LabeledVertex<L> for DiGraph<L>
Source§fn add_vertex(&mut self, label: L) -> VertexId
fn add_vertex(&mut self, label: L) -> VertexId
Adds a new vertex with label.
Auto Trait Implementations§
impl<L> Forget for DiGraph<L>
impl<L> Freeze for DiGraph<L>
impl<L> Move for DiGraph<L>
impl<L> RefUnwindSafe for DiGraph<L>where
L: RefUnwindSafe,
impl<L> Send for DiGraph<L>
impl<L> Sync for DiGraph<L>
impl<L> Unpin for DiGraph<L>
impl<L> UnsafeUnpin for DiGraph<L>where
*const u8 is !null: UnsafeUnpin,
PhantomData<Vec<usize>>: UnsafeUnpin,
PhantomData<L>: UnsafeUnpin,
impl<L> UnwindSafe for DiGraph<L>where
RawVecInner: UnwindSafe,
L: UnwindSafe,
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