[][src]Struct plexus::graph::RingView

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

View of a ring in a graph.

Rings are closed paths formed by arcs and their immediate neighboring arcs. In a consistent graph, every arc forms such a path. Such paths may or may not be occupied by faces. When no face is present, the ring forms a boundary.

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

Rings are notated by their path. A ring with a perimeter formed by vertices $A$, $B$, and $C$ is notated $\overrightarrow{\{A,B,C\}}$. Note that rotations of the set of vertices are equivalent, such as $\overrightarrow{\{B,C,A\}}$.

Methods

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

pub fn arity(&self) -> usize[src]

Gets the arity of the ring. This is the number of arcs that form the path.

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

Gets an iterator of views over the arcs within the ring.

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

pub fn into_ref(self) -> RingView<&'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.

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

pub fn into_arc(self) -> ArcView<M, G>[src]

Converts the ring into its originating arc.

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

Gets the originating arc of the ring.

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

pub fn distance(
    &self,
    source: Selector<VertexKey>,
    destination: Selector<VertexKey>
) -> Result<usize, GraphError>
[src]

Gets the distance (number of arcs) between two vertices within the ring.

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

Gets an iterator of views over the vertices within the ring.

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

pub fn into_face(self) -> Option<FaceView<M, G>>[src]

Converts the ring into its face.

If the path has no associated face, then None is returned.

pub fn face(&self) -> Option<FaceView<&M::Target, G>>[src]

Gets the face of the ring.

If the path has no associated face, then None is returned.

impl<'a, M, G> RingView<&'a mut M, G> where
    M: AsStorage<VertexPayload<G>> + AsStorage<ArcPayload<G>> + AsStorage<FacePayload<G>> + Default + Mutable<G>,
    G: 'a + GraphGeometry
[src]

pub fn get_or_insert_face(self) -> FaceView<&'a mut M, G>[src]

Gets the face of the ring or inserts a face if one does not already exist.

Returns the inserted face.

pub fn get_or_insert_face_with<F>(self, f: F) -> FaceView<&'a mut M, G> where
    F: FnOnce() -> G::Face
[src]

Gets the face of the ring or inserts a face if one does not already exist.

If a face is inserted, then the given function is used to get the geometry for the face.

Returns the inserted face.

Trait Implementations

impl<M, G> Ring<M, G> for RingView<M, G> where
    M: Reborrow,
    M::Target: AsStorage<ArcPayload<G>> + Consistent,
    G: GraphGeometry
[src]

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

Auto Trait Implementations

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

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

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

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

impl<M, G> RefUnwindSafe for RingView<M, G> where
    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, 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>,