pub struct DirectedGraph<'a, T: 'a + Eq + Hash> { /* private fields */ }
Expand description
A directed graph. Each edge has a source and target vertex.
§Warning
This implementation is not thread-safe
Implementations§
Source§impl<'a, T: 'a + Eq + Hash> DirectedGraph<'a, T>
impl<'a, T: 'a + Eq + Hash> DirectedGraph<'a, T>
Sourcepub fn new() -> DirectedGraph<'a, T>
pub fn new() -> DirectedGraph<'a, T>
Constructs an empty directed graph.
Sourcepub fn add_vertex(&mut self, v: &'a T)
pub fn add_vertex(&mut self, v: &'a T)
Adds a vertex labeled with the input vertex.
Returns true
i.f.f. this vertex was not previously in the graph.
Sourcepub fn add_edge(&mut self, v: &'a T, u: &'a T)
pub fn add_edge(&mut self, v: &'a T, u: &'a T)
Given two vertices, u
and v
, creates an edge u -> v
.
These vertices do not need to be in the graph before calling this method for this work.
Auto Trait Implementations§
impl<'a, T> Freeze for DirectedGraph<'a, T>
impl<'a, T> RefUnwindSafe for DirectedGraph<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for DirectedGraph<'a, T>where
T: Sync,
impl<'a, T> Sync for DirectedGraph<'a, T>where
T: Sync,
impl<'a, T> Unpin for DirectedGraph<'a, T>
impl<'a, T> UnwindSafe for DirectedGraph<'a, T>where
T: 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
Mutably borrows from an owned value. Read more