Skip to main content

EdgeMut

Trait EdgeMut 

Source
pub trait EdgeMut<'graph> {
    type Graph: GraphMut;

    // Required methods
    fn new(
        id: <Self::Graph as Graph>::EdgeId,
        graph: &'graph mut Self::Graph,
    ) -> Self;
    fn id(&self) -> <Self::Graph as Graph>::EdgeId;
    fn graph(&mut self) -> &mut Self::Graph;
    fn from_id(&self) -> <Self::Graph as Graph>::NodeId;
    fn to_id(&self) -> <Self::Graph as Graph>::NodeId;
    fn set_from(&mut self, node: <Self::Graph as Graph>::NodeId);

    // Provided methods
    fn from(&mut self) -> <Self::Graph as GraphMut>::NodeMut<'_> { ... }
    fn to(&mut self) -> <Self::Graph as GraphMut>::NodeMut<'_> { ... }
    fn as_ref(&mut self) -> <Self::Graph as Graph>::Edge<'_> { ... }
}

Required Associated Types§

Required Methods§

Source

fn new( id: <Self::Graph as Graph>::EdgeId, graph: &'graph mut Self::Graph, ) -> Self

Source

fn id(&self) -> <Self::Graph as Graph>::EdgeId

Returns this edge identifier.

Source

fn graph(&mut self) -> &mut Self::Graph

Returns the backing graph reference for this edge.

Source

fn from_id(&self) -> <Self::Graph as Graph>::NodeId

Returns the source node’s id for this edge.

Source

fn to_id(&self) -> <Self::Graph as Graph>::NodeId

Returns the destination node’s id for this edge.

Source

fn set_from(&mut self, node: <Self::Graph as Graph>::NodeId)

Redirects this edge to originate from node instead of its current source.

Provided Methods§

Source

fn from(&mut self) -> <Self::Graph as GraphMut>::NodeMut<'_>

Returns mutable access to the source node for this edge.

Source

fn to(&mut self) -> <Self::Graph as GraphMut>::NodeMut<'_>

Returns mutable access to the destination node for this edge.

Source

fn as_ref(&mut self) -> <Self::Graph as Graph>::Edge<'_>

Returns an immutable view of this edge handle.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'graph, NodeId: Identifier, EdgeId: Identifier, NodeData, EdgeData> EdgeMut<'graph> for EdgeMutRef<'graph, NodeId, EdgeId, NodeData, EdgeData>

Source§

type Graph = OwningGraph<NodeId, EdgeId, NodeData, EdgeData>