pub struct AdjacencyListGraph<T: Clone + Eq + Hash> { /* private fields */ }Expand description
A graph represented as an adjacency list.
Implementations§
Source§impl<T: Clone + Eq + Hash> AdjacencyListGraph<T>
impl<T: Clone + Eq + Hash> AdjacencyListGraph<T>
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Returns the number of vertices.
Sourcepub fn add_vertex(&mut self, vertex: T)
pub fn add_vertex(&mut self, vertex: T)
Adds a vertex.
Sourcepub fn remove_edge(&mut self, u: &T, v: &T)
pub fn remove_edge(&mut self, u: &T, v: &T)
Removes an edge.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for AdjacencyListGraph<T>
impl<T> RefUnwindSafe for AdjacencyListGraph<T>
impl<T> Send for AdjacencyListGraph<T>
impl<T> Sync for AdjacencyListGraph<T>
impl<T> Unpin for AdjacencyListGraph<T>
impl<T> UnsafeUnpin for AdjacencyListGraph<T>
impl<T> UnwindSafe for AdjacencyListGraph<T>
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