Struct AdjacencyArray

Source
pub struct AdjacencyArray<N, E> { /* private fields */ }
Expand description

A graph represented as adjacency array.

Trait Implementations§

Source§

impl<'a, N, E> ForwardNavigableGraph<'a, N, E> for AdjacencyArray<N, E>

Source§

type OutEdgeIterator = Map<Range<u32>, fn(u32) -> EdgeId>

An iterator over the out-edges of a node.
Source§

fn out_edges(&self, id: NodeId) -> Self::OutEdgeIterator

Returns an iterator over the out-edges of the node identified by the given id.
Source§

impl<N: Clone, E: Clone> From<&AdjacencyArray<N, E>> for SimpleGraph<N, E>

Source§

fn from(source: &AdjacencyArray<N, E>) -> Self

Converts to this type from the input type.
Source§

impl<N: Clone, E: Default + Clone> From<&SimpleGraph<N, E>> for AdjacencyArray<N, E>

Source§

fn from(source: &SimpleGraph<N, E>) -> Self

Converts to this type from the input type.
Source§

impl<N, E> Graph<N, E> for AdjacencyArray<N, E>

Source§

type NodeIdIterator = Map<Range<u32>, fn(u32) -> NodeId>

An iterator over all node ids of a graph.
Source§

type EdgeIdIterator = Map<Range<u32>, fn(u32) -> EdgeId>

An iterator over all edge ids of a graph.
Source§

fn node_len(&self) -> IdType

The amount of nodes in the graph.
Source§

fn edge_len(&self) -> IdType

The amount of edges in the graph.
Source§

fn node_id_iter(&self) -> Self::NodeIdIterator

Returns an iterator over all node ids in the graph.
Source§

fn edge_id_iter(&self) -> Self::EdgeIdIterator

Returns an iterator over all edge ids in the graph.
Source§

fn node_data(&self, id: NodeId) -> &N

Returns a reference to a nodes data, identified by the given id.
Source§

fn edge_data(&self, id: EdgeId) -> &E

Returns a reference to an edges data, identified by the given id.
Source§

fn edge(&self, id: EdgeId) -> EdgeRef<'_, E>

Returns an edge instance, identified by the given id.
Source§

fn edge_start(&self, id: EdgeId) -> NodeId

Returns the start node of the edge identified by the given id.
Source§

fn edge_end(&self, id: EdgeId) -> NodeId

Returns the end node of the edge identified by the given id.
Source§

fn is_node_id_valid(&self, id: NodeId) -> bool

Returns true if the given NodeId refers to a node in this graph.
Source§

fn is_edge_id_valid(&self, id: EdgeId) -> bool

Returns true if the given EdgeId refers to an edge in this graph.

Auto Trait Implementations§

§

impl<N, E> Freeze for AdjacencyArray<N, E>

§

impl<N, E> RefUnwindSafe for AdjacencyArray<N, E>

§

impl<N, E> Send for AdjacencyArray<N, E>
where N: Send, E: Send,

§

impl<N, E> Sync for AdjacencyArray<N, E>
where N: Sync, E: Sync,

§

impl<N, E> Unpin for AdjacencyArray<N, E>
where N: Unpin, E: Unpin,

§

impl<N, E> UnwindSafe for AdjacencyArray<N, E>
where N: UnwindSafe, E: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.