Trait rs_graph::attributed::AttributedGraph [−][src]
pub trait AttributedGraph<'a> {
type Graph: GraphType<'a>;
type Attributes: Attributes<Node = <Self::Graph as GraphType<'a>>::Node, Edge = <Self::Graph as GraphType<'a>>::Edge>;
fn split(&'a mut self) -> (&Self::Graph, Self::Attributes);
fn attr(&'a self) -> &'a <Self::Attributes as Attributes>::GraphAttr;
fn attr_mut(
&'a mut self
) -> &'a mut <Self::Attributes as Attributes>::GraphAttr;
fn node(
&'a self,
u: <Self::Graph as GraphType<'a>>::Node
) -> &'a <Self::Attributes as Attributes>::NodeAttr;
fn node_mut(
&'a mut self,
u: <Self::Graph as GraphType<'a>>::Node
) -> &'a mut <Self::Attributes as Attributes>::NodeAttr;
fn edge(
&'a self,
e: <Self::Graph as GraphType<'a>>::Edge
) -> &'a <Self::Attributes as Attributes>::EdgeAttr;
fn edge_mut(
&'a mut self,
e: <Self::Graph as GraphType<'a>>::Edge
) -> &'a mut <Self::Attributes as Attributes>::EdgeAttr;
}use rs-graph-derive crate instead
An attributed graph.
This trait adds three attributes to a graph:
- attributes for the graph itself via
attrandattr_mut. - attributes for the nodes via
nodeandnode_mut. - attributes for the edges via
nodeandnode_mut.
Furthermore, if you need to mutate some of the attributes, the
split method, splits the graph into two references: one for pure
read-only graph access and one for mutable access to the
attributes. This allows to mutate the attributes while ensuring
that the graph structure remains unchanged (and thus no nodes or
edges may be added.)
Associated Types
type Graph: GraphType<'a>[src]
use rs-graph-derive crate instead
type Attributes: Attributes<Node = <Self::Graph as GraphType<'a>>::Node, Edge = <Self::Graph as GraphType<'a>>::Edge>[src]
use rs-graph-derive crate instead
Required methods
fn split(&'a mut self) -> (&Self::Graph, Self::Attributes)[src]
use rs-graph-derive crate instead
Return a read-only graph reference and a mutable attributes reference.
fn attr(&'a self) -> &'a <Self::Attributes as Attributes>::GraphAttr[src]
use rs-graph-derive crate instead
Return the graph attributes.
fn attr_mut(&'a mut self) -> &'a mut <Self::Attributes as Attributes>::GraphAttr[src]
use rs-graph-derive crate instead
Return the graph attributes.
fn node(
&'a self,
u: <Self::Graph as GraphType<'a>>::Node
) -> &'a <Self::Attributes as Attributes>::NodeAttr[src]
&'a self,
u: <Self::Graph as GraphType<'a>>::Node
) -> &'a <Self::Attributes as Attributes>::NodeAttr
use rs-graph-derive crate instead
Return the attributes of a node.
fn node_mut(
&'a mut self,
u: <Self::Graph as GraphType<'a>>::Node
) -> &'a mut <Self::Attributes as Attributes>::NodeAttr[src]
&'a mut self,
u: <Self::Graph as GraphType<'a>>::Node
) -> &'a mut <Self::Attributes as Attributes>::NodeAttr
use rs-graph-derive crate instead
Return the attributes of a node.
fn edge(
&'a self,
e: <Self::Graph as GraphType<'a>>::Edge
) -> &'a <Self::Attributes as Attributes>::EdgeAttr[src]
&'a self,
e: <Self::Graph as GraphType<'a>>::Edge
) -> &'a <Self::Attributes as Attributes>::EdgeAttr
use rs-graph-derive crate instead
Return the attributes of an edge.
fn edge_mut(
&'a mut self,
e: <Self::Graph as GraphType<'a>>::Edge
) -> &'a mut <Self::Attributes as Attributes>::EdgeAttr[src]
&'a mut self,
e: <Self::Graph as GraphType<'a>>::Edge
) -> &'a mut <Self::Attributes as Attributes>::EdgeAttr
use rs-graph-derive crate instead
Return the attributes of an edge.
Implementors
impl<'a, G, Gx, Nx, Ex> AttributedGraph<'a> for Attributed<G, Gx, Nx, Ex> where
G: 'a + IndexGraph<'a>,
Gx: 'a + Default,
Nx: 'a + Default,
Ex: 'a + Default, [src]
impl<'a, G, Gx, Nx, Ex> AttributedGraph<'a> for Attributed<G, Gx, Nx, Ex> where
G: 'a + IndexGraph<'a>,
Gx: 'a + Default,
Nx: 'a + Default,
Ex: 'a + Default, [src]type Graph = G
use rs-graph-derive crate instead
type Attributes = GraphAttrs<'a, G, Gx, Nx, Ex>
use rs-graph-derive crate instead