pub struct LinkedListGraph<ID = u32, N = (), E = ()> { /* private fields */ }
Expand description

The linked list based graph data structure.

Implementations§

source§

impl<ID, N, E> LinkedListGraph<ID, N, E>where ID: PrimInt + Unsigned,

source

pub fn new() -> LinkedListGraph<ID, N, E>

Trait Implementations§

source§

impl<ID, N, E> Buildable for LinkedListGraph<ID, N, E>where ID: PrimInt + Unsigned + 'static, N: Default, E: Default,

§

type Builder = LinkedListGraphBuilder<ID, N, E>

source§

fn new_builder() -> Self::Builder

Create a new builder for this graph type.
source§

fn new_with<F>(f: F) -> Selfwhere F: FnOnce(&mut Self::Builder),

Create a new graph by passing the builder to the callback f. Read more
source§

impl<ID, N, E> Default for LinkedListGraph<ID, N, E>where ID: PrimInt + Unsigned,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de, ID, N, E> Deserialize<'de> for LinkedListGraph<ID, N, E>where ID: Deserialize<'de>, N: Deserialize<'de>, E: Deserialize<'de>,

source§

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<ID, N, E> Directed for LinkedListGraph<ID, N, E>where ID: PrimInt + Unsigned + 'static,

§

type OutIt<'a> = OutIt<ID> where N: 'a, E: 'a

Type of a graph iterator over edges leaving a node.
§

type InIt<'a> = NeighIt<ID> where N: 'a, E: 'a

Type of a graph iterator over edges entering a node.
§

type IncidentIt<'a> = NeighIt<ID> where N: 'a, E: 'a

Type of an iterator over all incident edges.
§

type DirectedEdge<'a> = <LinkedListGraph<ID, N, E> as GraphType>::Edge<'a> where N: 'a, E: 'a

Type of a directed edge.
source§

fn out_iter(&self, u: Self::Node<'_>) -> Self::OutIt<'_>

Return a graph iterator over the edges leaving a node.
source§

fn in_iter(&self, u: Self::Node<'_>) -> Self::InIt<'_>

Return a graph iterator over the edges leaving a node.
source§

fn incident_iter(&self, u: Self::Node<'_>) -> Self::IncidentIt<'_>

Return an iterator over all directed edges incident with a node.
source§

fn outedges( &self, u: Self::Node<'_> ) -> GraphIter<'_, Self, <Self as Directed>::OutIt<'_>> where Self: Sized,

Return an iterator over the edges leaving a node.
source§

fn outgoing(&self) -> OutEdges<'_, Self>where Self: Sized,

Return access to the outgoing arcs via an Adjacencies trait. Read more
source§

fn inedges( &self, u: Self::Node<'_> ) -> GraphIter<'_, Self, <Self as Directed>::InIt<'_>> where Self: Sized,

Return an iterator over the edges leaving a node.
source§

fn incoming(&self) -> InEdges<'_, Self>where Self: Sized,

Return access to the incoming arcs via an Adjacencies trait. Read more
source§

fn incident_edges( &self, u: Self::Node<'_> ) -> GraphIter<'_, Self, <Self as Directed>::IncidentIt<'_>> where Self: Sized,

Return an iterator over all directed edges incident with a node.
source§

impl<ID, N, E> EdgeAttributes<LinkedListGraph<ID, N, E>, E> for LinkedListGraph<ID, N, E>where ID: PrimInt + Unsigned + 'static,

source§

fn edge(&self, e: <Self as GraphType>::Edge<'_>) -> &E

source§

fn edge_mut(&mut self, e: <Self as GraphType>::Edge<'_>) -> &mut E

source§

impl<ID, N, E> FiniteDigraph for LinkedListGraph<ID, N, E>where ID: PrimInt + Unsigned + 'static,

source§

fn src(&self, e: Self::Edge<'_>) -> Self::Node<'_>

Return the source node of an edge.
source§

fn snk(&self, e: Self::Edge<'_>) -> Self::Node<'_>

Return the sink node of an edge.
source§

impl<ID, N, E> FiniteGraph for LinkedListGraph<ID, N, E>where ID: PrimInt + Unsigned + 'static,

§

type NodeIt<'a> = NodeIt<ID> where N: 'a, E: 'a

Type of an iterator over all nodes.
§

type EdgeIt<'a> = EdgeIt<ID> where N: 'a, E: 'a

Type of an iterator over all edges.
source§

fn num_nodes(&self) -> usize

Return the number of nodes in the graph.
source§

fn num_edges(&self) -> usize

Return the number of edges in the graph.
source§

fn nodes_iter(&self) -> Self::NodeIt<'_>

Return a graph iterator over all nodes.
source§

fn edges_iter(&self) -> Self::EdgeIt<'_>

Return a graph iterator over all edges. Read more
source§

fn enodes(&self, e: Self::Edge<'_>) -> (Self::Node<'_>, Self::Node<'_>)

Return the nodes connected by an edge. Read more
source§

fn nodes(&self) -> NodeIterator<'_, Self>where Self: Sized,

Return an iterator over all nodes.
source§

fn edges(&self) -> EdgeIterator<'_, Self>where Self: Sized,

Return an iterator over all edges. Read more
source§

impl<ID, N, E> GraphIterator<LinkedListGraph<ID, N, E>> for EdgeIt<ID>where ID: PrimInt + Unsigned,

§

type Item = Edge<ID>

source§

fn next(&mut self, _g: &LinkedListGraph<ID, N, E>) -> Option<Self::Item>

source§

fn size_hint(&self, _g: &LinkedListGraph<ID, N, E>) -> (usize, Option<usize>)

source§

fn count(self, _g: &LinkedListGraph<ID, N, E>) -> usize

source§

fn iter(self, g: &G) -> GraphIter<'_, G, Self> where G: Sized,

source§

impl<ID, N, E> GraphIterator<LinkedListGraph<ID, N, E>> for NeighIt<ID>where ID: PrimInt + Unsigned,

§

type Item = (Edge<ID>, Node<ID>)

source§

fn next(&mut self, g: &LinkedListGraph<ID, N, E>) -> Option<Self::Item>

source§

fn size_hint(&self, _g: &G) -> (usize, Option<usize>)

source§

fn count(self, g: &G) -> usize

source§

fn iter(self, g: &G) -> GraphIter<'_, G, Self> where G: Sized,

source§

impl<ID, N, E> GraphIterator<LinkedListGraph<ID, N, E>> for NodeIt<ID>where ID: PrimInt + Unsigned,

§

type Item = Node<ID>

source§

fn next(&mut self, _g: &LinkedListGraph<ID, N, E>) -> Option<Self::Item>

source§

fn size_hint(&self, _g: &LinkedListGraph<ID, N, E>) -> (usize, Option<usize>)

source§

fn count(self, _g: &LinkedListGraph<ID, N, E>) -> usize

source§

fn iter(self, g: &G) -> GraphIter<'_, G, Self> where G: Sized,

source§

impl<ID, N, E> GraphIterator<LinkedListGraph<ID, N, E>> for OutIt<ID>where ID: PrimInt + Unsigned,

§

type Item = (Edge<ID>, Node<ID>)

source§

fn next(&mut self, g: &LinkedListGraph<ID, N, E>) -> Option<Self::Item>

source§

fn size_hint(&self, _g: &G) -> (usize, Option<usize>)

source§

fn count(self, g: &G) -> usize

source§

fn iter(self, g: &G) -> GraphIter<'_, G, Self> where G: Sized,

source§

impl<ID, N, E> GraphType for LinkedListGraph<ID, N, E>where ID: PrimInt + Unsigned,

§

type Node<'a> = Node<ID>

Type of a node.
§

type Edge<'a> = Edge<ID>

Type of an edge.
source§

impl<ID, N, E> IndexGraph for LinkedListGraph<ID, N, E>where ID: PrimInt + Unsigned + 'static,

source§

fn node_id(&self, u: Self::Node<'_>) -> usize

Return a unique id associated with a node.
source§

fn id2node(&self, id: usize) -> Self::Node<'_>

Return the node associated with the given id. Read more
source§

fn edge_id(&self, e: Self::Edge<'_>) -> usize

Return a unique id associated with an edge. Read more
source§

fn id2edge(&self, id: usize) -> Self::Edge<'_>

Return the edge associated with the given id. Read more
source§

impl<ID, N, E> NodeAttributes<LinkedListGraph<ID, N, E>, N> for LinkedListGraph<ID, N, E>where ID: PrimInt + Unsigned + 'static,

source§

fn node(&self, u: <Self as GraphType>::Node<'_>) -> &N

source§

fn node_mut(&mut self, u: <Self as GraphType>::Node<'_>) -> &mut N

source§

impl<ID, N, E> Serialize for LinkedListGraph<ID, N, E>where ID: Serialize, N: Serialize, E: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<ID, N, E> Undirected for LinkedListGraph<ID, N, E>where ID: PrimInt + Unsigned + 'static,

§

type NeighIt<'a> = NeighIt<ID> where N: 'a, E: 'a

Type of a graph iterator over all incident edges.
source§

fn neigh_iter(&self, u: Self::Node<'_>) -> Self::NeighIt<'_>

Return a graph iterator over the edges adjacent to some node.
source§

fn neighs( &self, u: Self::Node<'_> ) -> GraphIter<'_, Self, <Self as Undirected>::NeighIt<'_>> where Self: Sized,

Return an iterator over the edges adjacent to some node.
source§

fn neighbors(&self) -> Neighbors<'_, Self>where Self: Sized,

Return access to the neighbors via an Adjacencies trait. Read more

Auto Trait Implementations§

§

impl<ID, N, E> RefUnwindSafe for LinkedListGraph<ID, N, E>where E: RefUnwindSafe, ID: RefUnwindSafe, N: RefUnwindSafe,

§

impl<ID, N, E> Send for LinkedListGraph<ID, N, E>where E: Send, ID: Send, N: Send,

§

impl<ID, N, E> Sync for LinkedListGraph<ID, N, E>where E: Sync, ID: Sync, N: Sync,

§

impl<ID, N, E> Unpin for LinkedListGraph<ID, N, E>where E: Unpin, ID: Unpin, N: Unpin,

§

impl<ID, N, E> UnwindSafe for LinkedListGraph<ID, N, E>where E: UnwindSafe, ID: UnwindSafe, N: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

source§

impl<G> Digraph for Gwhere G: FiniteDigraph + Directed,

source§

impl<G> Graph for Gwhere G: FiniteGraph + Undirected,

source§

impl<T> IndexDigraph for Twhere T: IndexGraph + Digraph,