[][src]Struct plexus::graph::PathView

pub struct PathView<M, G> where
    M: Reborrow,
    M::Target: AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + Consistent,
    G: GraphGeometry
{ /* fields omitted */ }

View of a path in a graph.

Provides a representation of non-intersecting paths in a graph. A path is conceptually an ordered set of vertices that are joined by arcs. A path over vertices $A$, $B$, and $C$ is notated $\overrightarrow{\{A, B, C\}}$.

Paths have no associated payload and do not directly expose geometry (PathView does not implement Deref or expose a geometry field). See the module documentation for more information about topological views.

Methods

impl<M, G> PathView<M, G> where
    M: Reborrow,
    M::Target: AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + Consistent,
    G: GraphGeometry
[src]

pub fn push(
    &mut self,
    destination: Selector<VertexKey>
) -> Result<ArcKey, GraphError>
[src]

Pushes a vertex onto the path.

pub fn pop(&mut self) -> Option<ArcKey>[src]

Pops the terminating vertex from the path.

pub fn pop_swap(&mut self, destination: Selector<VertexKey>) -> Option<ArcKey>[src]

Exchanges the terminating vertex of the path.

Unlike pop, this function allows an existing path's originating arc to be changed by exchanging the destination vertex.

pub fn first(&self) -> VertexView<&M::Target, G>[src]

Gets the initiating vertex of the path.

pub fn last(&self) -> VertexView<&M::Target, G>[src]

Gets the terminating vertex of the path.

pub fn vertices(&self) -> impl Iterator<Item = VertexView<&M::Target, G>>[src]

Gets an iterator over the vertices in the path.

pub fn arcs(&self) -> impl Iterator<Item = ArcView<&M::Target, G>>[src]

Gets an iterator over the arcs in the path.

pub fn is_open(&self) -> bool[src]

Returns true if the path is open.

An open path is a path that does not form a loop.

pub fn is_closed(&self) -> bool[src]

Returns true if the path is closed.

A closed path is a path that forms a loop by starting and ending at the same vertex. Note that this exludes paths that self-intersect and include arcs that do not participate in loops. PathView disallows such paths.

impl<'a, M, G> PathView<&'a mut M, G> where
    M: 'a + AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + AsStorageMut<ArcPayload<G>> + AsStorageMut<VertexPayload<G>> + Consistent,
    G: 'a + GraphGeometry
[src]

pub fn into_ref(self) -> PathView<&'a M, G>[src]

Converts a mutable view into an immutable view.

This is useful when mutations are not (or no longer) needed and mutual access is desired.

Trait Implementations

impl<M: Clone, G: Clone> Clone for PathView<M, G> where
    M: Reborrow,
    M::Target: AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + Consistent,
    G: GraphGeometry
[src]

impl<M, G> PartialEq<PathView<M, G>> for PathView<M, G> where
    M: Reborrow,
    M::Target: AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + Consistent,
    G: GraphGeometry
[src]

Auto Trait Implementations

impl<M, G> Send for PathView<M, G> where
    G: Send,
    M: Send

impl<M, G> Sync for PathView<M, G> where
    G: Sync,
    M: Sync

impl<M, G> Unpin for PathView<M, G> where
    G: Unpin,
    M: Unpin

impl<M, G> UnwindSafe for PathView<M, G> where
    G: UnwindSafe,
    M: UnwindSafe

impl<M, G> RefUnwindSafe for PathView<M, G> where
    G: RefUnwindSafe,
    M: RefUnwindSafe

Blanket Implementations

impl<T> FromGeometry<T> for T[src]

impl<T, U> IntoGeometry<U> for T where
    U: FromGeometry<T>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,