Skip to main content

EdgeSelector

Enum EdgeSelector 

Source
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_t

The vertex.

§mode: NeighborMode

Which 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.

§directed: bool

Whether to respect edge directions.

§

Path

The edges along a path given as a vertex sequence.

Fields

§vertices: Cow<'a, [igraph_int_t]>

The vertices of the path.

§directed: bool

Whether to respect edge directions.

§

AllBetween

All the (possibly multiple) edges between two vertices.

Fields

§from: igraph_int_t

Source vertex.

§to: igraph_int_t

Target vertex.

§directed: bool

Whether to respect edge directions.

Implementations§

Source§

impl<'a> EdgeSelector<'a>

Source

pub fn incident(vertex: igraph_int_t, mode: NeighborMode) -> Self

The edges incident to vertex (shorthand for EdgeSelector::Incident).

Source

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).

Source

pub fn path(vertices: &'a [igraph_int_t], directed: bool) -> Self

The edges along a vertex path (shorthand for EdgeSelector::Path).

Source

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<'_>

Source

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>

Source§

fn clone(&self) -> EdgeSelector<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for EdgeSelector<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for EdgeSelector<'a>

Source§

impl<'a> From<&'a Vec<i64>> for EdgeSelector<'a>

Source§

fn from(e: &'a Vec<igraph_int_t>) -> Self

Converts to this type from the input type.
Source§

impl<'a, const N: usize> From<&'a [i64; N]> for EdgeSelector<'a>

Source§

fn from(e: &'a [igraph_int_t; N]) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a [i64]> for EdgeSelector<'a>

Source§

fn from(e: &'a [igraph_int_t]) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a igraph_vector_int_t> for EdgeSelector<'a>

Source§

fn from(e: &'a VectorInt) -> Self

Converts to this type from the input type.
Source§

impl From<Range<i64>> for EdgeSelector<'_>

Source§

fn from(r: Range<igraph_int_t>) -> Self

Converts to this type from the input type.
Source§

impl From<RangeFull> for EdgeSelector<'_>

Source§

fn from(_: RangeFull) -> Self

Converts to this type from the input type.
Source§

impl From<RangeInclusive<i64>> for EdgeSelector<'_>

Source§

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<'_>

Source§

fn from(e: Vec<igraph_int_t>) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for EdgeSelector<'_>

Source§

fn from(e: igraph_int_t) -> Self

Converts to this type from the input type.
Source§

impl<'a> PartialEq for EdgeSelector<'a>

Source§

fn eq(&self, other: &EdgeSelector<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> StructuralPartialEq for EdgeSelector<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for EdgeSelector<'a>

§

impl<'a> RefUnwindSafe for EdgeSelector<'a>

§

impl<'a> Send for EdgeSelector<'a>

§

impl<'a> Sync for EdgeSelector<'a>

§

impl<'a> Unpin for EdgeSelector<'a>

§

impl<'a> UnsafeUnpin for EdgeSelector<'a>

§

impl<'a> UnwindSafe for EdgeSelector<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.