pub struct DirectedGraph<Vertex: Eq + Hash + Clone, Edge: Eq + Hash> { /* private fields */ }Implementations§
Source§impl<Vertex: Eq + Hash + Clone, Edge: Eq + Hash> DirectedGraph<Vertex, Edge>
impl<Vertex: Eq + Hash + Clone, Edge: Eq + Hash> DirectedGraph<Vertex, Edge>
pub fn new() -> Self
pub fn contains(&self, v: &Vertex) -> bool
pub fn connections( &self, v: &Vertex, ) -> Result<HashSet<(&Vertex, &Edge)>, String>
pub fn connect(&mut self, from: Vertex, to: Vertex, edge: Edge)
pub fn dfs<F: FnMut(&Vertex)>(&self, start: &Vertex, op: F)
pub fn bfs<F: FnMut(&Vertex)>(&self, start: &Vertex, op: F)
pub fn to_dot<F: Fn(&Vertex) -> String>(&self, repr: F) -> String
Trait Implementations§
Source§impl<Vertex: Clone + Eq + Hash + Clone, Edge: Clone + Eq + Hash> Clone for DirectedGraph<Vertex, Edge>
impl<Vertex: Clone + Eq + Hash + Clone, Edge: Clone + Eq + Hash> Clone for DirectedGraph<Vertex, Edge>
Source§fn clone(&self) -> DirectedGraph<Vertex, Edge>
fn clone(&self) -> DirectedGraph<Vertex, Edge>
Returns a duplicate 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<Vertex: Debug + Eq + Hash + Clone, Edge: Debug + Eq + Hash> Debug for DirectedGraph<Vertex, Edge>
impl<Vertex: Debug + Eq + Hash + Clone, Edge: Debug + Eq + Hash> Debug for DirectedGraph<Vertex, Edge>
Source§impl<Vertex: Default + Eq + Hash + Clone, Edge: Default + Eq + Hash> Default for DirectedGraph<Vertex, Edge>
impl<Vertex: Default + Eq + Hash + Clone, Edge: Default + Eq + Hash> Default for DirectedGraph<Vertex, Edge>
Source§fn default() -> DirectedGraph<Vertex, Edge>
fn default() -> DirectedGraph<Vertex, Edge>
Returns the “default value” for a type. Read more
Source§impl<'de, Vertex, Edge> Deserialize<'de> for DirectedGraph<Vertex, Edge>
impl<'de, Vertex, Edge> Deserialize<'de> for DirectedGraph<Vertex, Edge>
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
Source§impl<Vertex, Edge> Serialize for DirectedGraph<Vertex, Edge>
impl<Vertex, Edge> Serialize for DirectedGraph<Vertex, Edge>
Auto Trait Implementations§
impl<Vertex, Edge> Freeze for DirectedGraph<Vertex, Edge>
impl<Vertex, Edge> RefUnwindSafe for DirectedGraph<Vertex, Edge>where
Vertex: RefUnwindSafe,
Edge: RefUnwindSafe,
impl<Vertex, Edge> Send for DirectedGraph<Vertex, Edge>
impl<Vertex, Edge> Sync for DirectedGraph<Vertex, Edge>
impl<Vertex, Edge> Unpin for DirectedGraph<Vertex, Edge>
impl<Vertex, Edge> UnwindSafe for DirectedGraph<Vertex, Edge>where
Vertex: UnwindSafe,
Edge: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more