Struct graphific::BasicDirectedGraph [−][src]
A basic implementation of a directed graph. It doesn't allow multiple edges but allow loops.
Implementations
impl<K, V> BasicDirectedGraph<K, V> where
K: Key,
V: Value,
[src]
K: Key,
V: Value,
Trait Implementations
impl<K, V> Algorithms<K, V> for BasicDirectedGraph<K, V> where
K: Key,
V: Value,
[src]
K: Key,
V: Value,
fn bfs(&self) -> Option<Self>
[src]
fn bfs_with_starting_vertex(
&self,
starting_vertex: &Vertex<K, V>
) -> Option<Self>
[src]
&self,
starting_vertex: &Vertex<K, V>
) -> Option<Self>
fn dfs(&self) -> Option<Self>
[src]
fn dfs_with_starting_vertex(
&self,
starting_vertex: &Vertex<K, V>
) -> Option<Self>
[src]
&self,
starting_vertex: &Vertex<K, V>
) -> Option<Self>
impl<K, V> AnyGraph<K, V> for BasicDirectedGraph<K, V> where
K: Key,
V: Value,
[src]
K: Key,
V: Value,
fn vertices(&self) -> Vec<Vertex<K, V>>
[src]
Get the vertices of the graph. Complexity: O(1*).
fn edges(&self) -> Vec<Edge<K>>
[src]
Get the edges of the graph. Complexity: O(1*).
fn add_vertex(&self, vertex: Vertex<K, V>) -> Option<Self>
[src]
Add a new vertex then return the graph. Complexity: O(1*).
fn remove_vertex(
&self,
vertex: &Vertex<K, V>
) -> Option<(Self, Vertex<K, V>, Vec<Edge<K>>)>
[src]
&self,
vertex: &Vertex<K, V>
) -> Option<(Self, Vertex<K, V>, Vec<Edge<K>>)>
Remove a vertex then return the new graph, the deleted vertex and its edges. Complexity: O(E).
fn remove_all_vertices(&self) -> Option<(Self, Vec<Vertex<K, V>>, Vec<Edge<K>>)>
[src]
Remove all vertices then return the new graph, the deleted vertices and all the edges. Complexity: O(1*).
fn remove_vertex_where_key(
&self,
key: K
) -> Option<(Self, Vertex<K, V>, Vec<Edge<K>>)>
[src]
&self,
key: K
) -> Option<(Self, Vertex<K, V>, Vec<Edge<K>>)>
Remove a vertex by its key then return the new graph, the deleted vertex and its edges. Complexity: O(E).
fn add_edge(&self, edge: Edge<K>) -> Option<Self>
[src]
Add a new edge then return the new graph. Complexity: O(1*).
fn add_edge_between_keys(&self, key_from: K, key_to: K) -> Option<Self>
[src]
Add a new edge between 2 keys then return the new graph. Complexity: O(1*).
fn remove_edge(&self, edge: &Edge<K>) -> Option<(Self, Edge<K>)>
[src]
Remove an existing edge then return the new graph and the deleted edge. Complexity: O(1*).
fn remove_edge_where_keys(
&self,
key_from: K,
key_to: K
) -> Option<(Self, Edge<K>)>
[src]
&self,
key_from: K,
key_to: K
) -> Option<(Self, Edge<K>)>
Remove an existing edge by their keys, then return the new graph and the deleted edge. Complexity: O(1*).
fn remove_all_edges(&self) -> Option<(Self, Vec<Edge<K>>)>
[src]
Remove all the edges then return the new graph and all the deleted edges. Complexity: O(1*).
fn remove_all_edges_where_vertex(
&self,
vertex: &Vertex<K, V>
) -> Option<(Self, Vec<Edge<K>>)>
[src]
&self,
vertex: &Vertex<K, V>
) -> Option<(Self, Vec<Edge<K>>)>
Remove all existing edges from or to a given vertex, then return the new graph and the deleted edges. Complexity: O(E).
fn remove_all_edges_where_key(
&self,
key_from: K
) -> Option<(Self, Vec<Edge<K>>)>
[src]
&self,
key_from: K
) -> Option<(Self, Vec<Edge<K>>)>
Remove all existing edges from or to a given key, then return the new graph and the deleted edges. Complexity: O(E).
fn remove_all_edges_from_vertex(
&self,
vertex: &Vertex<K, V>
) -> Option<(Self, Vec<Edge<K>>)>
[src]
&self,
vertex: &Vertex<K, V>
) -> Option<(Self, Vec<Edge<K>>)>
Remove all existing edges from a given vertex, then return the new graph and the deleted edges. Complexity: O(E).
fn remove_all_edges_from_key(&self, key_from: K) -> Option<(Self, Vec<Edge<K>>)>
[src]
Remove all existing edges from a given key, then return the new graph and the deleted edges. Complexity: O(E).
impl<K: Clone, V: Clone> Clone for BasicDirectedGraph<K, V> where
K: Key,
V: Value,
[src]
K: Key,
V: Value,
fn clone(&self) -> BasicDirectedGraph<K, V>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<K, V> Kinship<K, V> for BasicDirectedGraph<K, V> where
K: Key,
V: Value,
[src]
K: Key,
V: Value,
fn successors(&self) -> HashMap<Vertex<K, V>, Vec<Edge<K>>, RandomState>
[src]
Get the successors of each vertex. Complexity: O(V + E).
fn predecessors(&self) -> HashMap<Vertex<K, V>, Vec<Edge<K>>, RandomState>
[src]
Get the predecessors of each vertex. Complexity: O(V + E).
fn successors_as_key_and_edges(&self) -> HashMap<K, Vec<Edge<K>>>
[src]
fn predecessors_as_key_and_edges(&self) -> HashMap<K, Vec<Edge<K>>>
[src]
fn key_vertex_map(&self) -> HashMap<K, Vertex<K, V>>
[src]
impl<K: PartialEq, V: PartialEq> PartialEq<BasicDirectedGraph<K, V>> for BasicDirectedGraph<K, V> where
K: Key,
V: Value,
[src]
K: Key,
V: Value,
fn eq(&self, other: &BasicDirectedGraph<K, V>) -> bool
[src]
fn ne(&self, other: &BasicDirectedGraph<K, V>) -> bool
[src]
impl<K, V> StructuralPartialEq for BasicDirectedGraph<K, V> where
K: Key,
V: Value,
[src]
K: Key,
V: Value,
Auto Trait Implementations
impl<K, V> RefUnwindSafe for BasicDirectedGraph<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
[src]
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for BasicDirectedGraph<K, V> where
K: Send,
V: Send,
[src]
K: Send,
V: Send,
impl<K, V> Sync for BasicDirectedGraph<K, V> where
K: Sync,
V: Sync,
[src]
K: Sync,
V: Sync,
impl<K, V> Unpin for BasicDirectedGraph<K, V> where
K: Unpin,
V: Unpin,
[src]
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for BasicDirectedGraph<K, V> where
K: UnwindSafe,
V: UnwindSafe,
[src]
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,