[][src]Trait graphity::node::NodeIndex

pub trait NodeIndex: Copy + Hash + Eq {
    type ConsumerIndex: ConsumerIndex<NodeIndex = Self, Consumer = Self::Consumer>;
    type ProducerIndex: ProducerIndex<NodeIndex = Self, Producer = Self::Producer>;
    pub fn consumer<IntoC>(&self, consumer: IntoC) -> Self::ConsumerIndex
    where
        IntoC: Into<Self::Consumer>
;
pub fn producer<IntoP>(&self, producer: IntoP) -> Self::ProducerIndex
    where
        IntoP: Into<Self::Producer>
; }

An index serving as a reference to a node stored in a graph.

It can be used as a reference to read or delete an existing node. It can be used to access a consumer or producer index of the given node too and then be used to lookup, add or remove edges in the graph.

Example

let generator = graph.add_node(Generator(1));
let echo = graph.add_node(Echo::default());

graph.add_edge(
    generator.producer(GeneratorProducer),
    echo.consumer(EchoConsumer),
);

graph.remove_node(&echo);

Associated Types

type ConsumerIndex: ConsumerIndex<NodeIndex = Self, Consumer = Self::Consumer>[src]

type ProducerIndex: ProducerIndex<NodeIndex = Self, Producer = Self::Producer>[src]

Loading content...

Required methods

pub fn consumer<IntoC>(&self, consumer: IntoC) -> Self::ConsumerIndex where
    IntoC: Into<Self::Consumer>, 
[src]

pub fn producer<IntoP>(&self, producer: IntoP) -> Self::ProducerIndex where
    IntoP: Into<Self::Producer>, 
[src]

Loading content...

Implementors

Loading content...