Struct graphene::core::BaseEdge
[−]
[src]
pub struct BaseEdge<V, W> where
V: Vertex,
W: Weight, {
pub source: V,
pub sink: V,
pub weight: W,
}
Represents an edge between two vertices in a graph.
The edge is implicitly directed from the source
to the sink
with some weight weight
.
Parameters:
V
: The type of the vertices.W
: The type of the weight.
Fields
source: V
The vertex the edge starts in.
sink: V
The vertex the edge ends in.
weight: W
The weight of the edge.
Methods
impl<V: Vertex, W: Weight> BaseEdge<V, W>
[src]
pub fn new(source: V, sink: V, weight: W) -> BaseEdge<V, W>
[src]
Creates a new edge
pub fn source(&self) -> V
[src]
Returns a copy of the vertex the edge starts in.
pub fn sink(&self) -> V
[src]
Returns a copy of the vertex the edge ends in.
pub fn weight(&self) -> W
[src]
Returns a copy of the weight of the edge.
Trait Implementations
impl<V: Copy, W: Copy> Copy for BaseEdge<V, W> where
V: Vertex,
W: Weight,
[src]
V: Vertex,
W: Weight,
impl<V: Clone, W: Clone> Clone for BaseEdge<V, W> where
V: Vertex,
W: Weight,
[src]
V: Vertex,
W: Weight,
fn clone(&self) -> BaseEdge<V, W>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<V: Debug, W: Debug> Debug for BaseEdge<V, W> where
V: Vertex,
W: Weight,
[src]
V: Vertex,
W: Weight,
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<V: PartialEq, W: PartialEq> PartialEq for BaseEdge<V, W> where
V: Vertex,
W: Weight,
[src]
V: Vertex,
W: Weight,
fn eq(&self, __arg_0: &BaseEdge<V, W>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &BaseEdge<V, W>) -> bool
[src]
This method tests for !=
.
impl<V: Eq, W: Eq> Eq for BaseEdge<V, W> where
V: Vertex,
W: Weight,
[src]
V: Vertex,
W: Weight,