pub enum EdgeSelector<'a> {
All,
AllOrdered(EdgeOrder),
None,
Single(igraph_int_t),
List(Cow<'a, [igraph_int_t]>),
Range(igraph_int_t, igraph_int_t),
Incident {
vertex: igraph_int_t,
mode: NeighborMode,
},
Pairs {
pairs: Cow<'a, [(igraph_int_t, igraph_int_t)]>,
directed: bool,
},
Path {
vertices: Cow<'a, [igraph_int_t]>,
directed: bool,
},
AllBetween {
from: igraph_int_t,
to: igraph_int_t,
directed: bool,
},
}Expand description
A set of edges, see the module docs.
Variants§
All
All edges, ordered by id.
AllOrdered(EdgeOrder)
All edges, in the given order.
None
No edge.
Single(igraph_int_t)
A single edge.
List(Cow<'a, [igraph_int_t]>)
The listed edges, in the given order.
Range(igraph_int_t, igraph_int_t)
Edges with id in start..end; like a Rust range it is empty
(and selects nothing, whatever the graph) when start >= end.
Incident
Edges incident to a vertex, each loop edge listed once (use
Graph::incident_edges to choose how
loops are counted).
Fields
vertex: igraph_int_tThe vertex.
mode: NeighborModeWhich incident edges, for directed graphs.
Pairs
The edges connecting the given (from, to) vertex pairs (one per pair).
Fields
pairs: Cow<'a, [(igraph_int_t, igraph_int_t)]>Endpoint pairs.
Path
The edges along a path given as a vertex sequence.
Fields
vertices: Cow<'a, [igraph_int_t]>The vertices of the path.
AllBetween
All the (possibly multiple) edges between two vertices.
Implementations§
Source§impl<'a> EdgeSelector<'a>
impl<'a> EdgeSelector<'a>
Sourcepub fn incident(vertex: igraph_int_t, mode: NeighborMode) -> Self
pub fn incident(vertex: igraph_int_t, mode: NeighborMode) -> Self
The edges incident to vertex (shorthand for EdgeSelector::Incident).
Sourcepub fn pairs(pairs: &'a [(igraph_int_t, igraph_int_t)], directed: bool) -> Self
pub fn pairs(pairs: &'a [(igraph_int_t, igraph_int_t)], directed: bool) -> Self
One edge between each (from, to) pair (shorthand for
EdgeSelector::Pairs).
Sourcepub fn path(vertices: &'a [igraph_int_t], directed: bool) -> Self
pub fn path(vertices: &'a [igraph_int_t], directed: bool) -> Self
The edges along a vertex path (shorthand for EdgeSelector::Path).
Sourcepub fn all_between(from: igraph_int_t, to: igraph_int_t, directed: bool) -> Self
pub fn all_between(from: igraph_int_t, to: igraph_int_t, directed: bool) -> Self
All edges between two vertices (shorthand for EdgeSelector::AllBetween).
Source§impl EdgeSelector<'_>
impl EdgeSelector<'_>
Sourcepub fn to_raw(&self) -> Result<RawEs>
pub fn to_raw(&self) -> Result<RawEs>
Builds the raw igraph selector (igraph_es_t), for calling raw FFI
functions; the safe wrappers of the crate do it for you. Empty ranges
select nothing, as for VertexSelector::to_raw.
§Errors
Only if igraph fails to build the selector (e.g. out of memory); ids are validated when the selector is used.
Trait Implementations§
Source§impl<'a> Clone for EdgeSelector<'a>
impl<'a> Clone for EdgeSelector<'a>
Source§fn clone(&self) -> EdgeSelector<'a>
fn clone(&self) -> EdgeSelector<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for EdgeSelector<'a>
impl<'a> Debug for EdgeSelector<'a>
impl<'a> Eq for EdgeSelector<'a>
Source§impl<'a> From<&'a Vec<i64>> for EdgeSelector<'a>
impl<'a> From<&'a Vec<i64>> for EdgeSelector<'a>
Source§fn from(e: &'a Vec<igraph_int_t>) -> Self
fn from(e: &'a Vec<igraph_int_t>) -> Self
Source§impl<'a, const N: usize> From<&'a [i64; N]> for EdgeSelector<'a>
impl<'a, const N: usize> From<&'a [i64; N]> for EdgeSelector<'a>
Source§fn from(e: &'a [igraph_int_t; N]) -> Self
fn from(e: &'a [igraph_int_t; N]) -> Self
Source§impl<'a> From<&'a [i64]> for EdgeSelector<'a>
impl<'a> From<&'a [i64]> for EdgeSelector<'a>
Source§fn from(e: &'a [igraph_int_t]) -> Self
fn from(e: &'a [igraph_int_t]) -> Self
Source§impl<'a> From<&'a igraph_vector_int_t> for EdgeSelector<'a>
impl<'a> From<&'a igraph_vector_int_t> for EdgeSelector<'a>
Source§impl From<Range<i64>> for EdgeSelector<'_>
impl From<Range<i64>> for EdgeSelector<'_>
Source§fn from(r: Range<igraph_int_t>) -> Self
fn from(r: Range<igraph_int_t>) -> Self
Source§impl From<RangeFull> for EdgeSelector<'_>
impl From<RangeFull> for EdgeSelector<'_>
Source§impl From<RangeInclusive<i64>> for EdgeSelector<'_>
impl From<RangeInclusive<i64>> for EdgeSelector<'_>
Source§fn from(r: RangeInclusive<igraph_int_t>) -> Self
fn from(r: RangeInclusive<igraph_int_t>) -> Self
a..=b selects the edges a, a + 1, ..., b (none if a > b).
Source§impl From<Vec<i64>> for EdgeSelector<'_>
impl From<Vec<i64>> for EdgeSelector<'_>
Source§fn from(e: Vec<igraph_int_t>) -> Self
fn from(e: Vec<igraph_int_t>) -> Self
Source§impl From<i64> for EdgeSelector<'_>
impl From<i64> for EdgeSelector<'_>
Source§fn from(e: igraph_int_t) -> Self
fn from(e: igraph_int_t) -> Self
Source§impl<'a> PartialEq for EdgeSelector<'a>
impl<'a> PartialEq for EdgeSelector<'a>
Source§fn eq(&self, other: &EdgeSelector<'a>) -> bool
fn eq(&self, other: &EdgeSelector<'a>) -> bool
self and other values to be equal, and is used by ==.