[−][src]Struct plexus::graph::PathView
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]
M: Reborrow,
M::Target: AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + Consistent,
G: GraphGeometry,
pub fn push(
&mut self,
destination: Selector<VertexKey>
) -> Result<ArcKey, GraphError>
[src]
&mut self,
destination: Selector<VertexKey>
) -> Result<ArcKey, GraphError>
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]
M: 'a + AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + AsStorageMut<ArcPayload<G>> + AsStorageMut<VertexPayload<G>> + Consistent,
G: 'a + GraphGeometry,
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]
M: Reborrow,
M::Target: AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + Consistent,
G: GraphGeometry,
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]
M: Reborrow,
M::Target: AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + Consistent,
G: GraphGeometry,
Auto Trait Implementations
impl<M, G> Send for PathView<M, G> where
G: Send,
M: Send,
G: Send,
M: Send,
impl<M, G> Sync for PathView<M, G> where
G: Sync,
M: Sync,
G: Sync,
M: Sync,
impl<M, G> Unpin for PathView<M, G> where
G: Unpin,
M: Unpin,
G: Unpin,
M: Unpin,
impl<M, G> UnwindSafe for PathView<M, G> where
G: UnwindSafe,
M: UnwindSafe,
G: UnwindSafe,
M: UnwindSafe,
impl<M, G> RefUnwindSafe for PathView<M, G> where
G: RefUnwindSafe,
M: RefUnwindSafe,
G: RefUnwindSafe,
M: RefUnwindSafe,
Blanket Implementations
impl<T> FromGeometry<T> for T
[src]
fn from_geometry(T) -> T
[src]
impl<T, U> IntoGeometry<U> for T where
U: FromGeometry<T>,
[src]
U: FromGeometry<T>,
fn into_geometry(Self) -> U
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,