Enum petgraph::data::Element[][src]

pub enum Element<N, E> {
    Node {
        weight: N,
    },
    Edge {
        source: usize,
        target: usize,
        weight: E,
    },
}

A graph element.

A sequence of Elements, for example an iterator, is laid out as follows: Nodes are implicitly given the index of their appearance in the sequence. The edges’ source and target fields refer to these indices.

Variants

Node

A graph node.

Show fields

Fields of Node

weight: N
Edge

A graph edge.

Show fields

Fields of Edge

source: usizetarget: usizeweight: E

Trait Implementations

impl<N: Clone, E: Clone> Clone for Element<N, E>[src]

impl<N: Debug, E: Debug> Debug for Element<N, E>[src]

impl<N: PartialEq, E: PartialEq> PartialEq<Element<N, E>> for Element<N, E>[src]

impl<N: Eq, E: Eq> Eq for Element<N, E>[src]

impl<N, E> StructuralEq for Element<N, E>[src]

impl<N, E> StructuralPartialEq for Element<N, E>[src]

Auto Trait Implementations

impl<N, E> RefUnwindSafe for Element<N, E> where
    E: RefUnwindSafe,
    N: RefUnwindSafe

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

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

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

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.