[−][src]Struct plexus::graph::RingView
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]
M: Reborrow,
M::Target: AsStorage<ArcPayload<G>> + Consistent,
G: GraphGeometry,
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]
&self
) -> impl Clone + Iterator<Item = ArcView<&M::Target, G>>
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]
M: AsStorage<ArcPayload<G>> + AsStorageMut<ArcPayload<G>> + Consistent,
G: 'a + GraphGeometry,
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]
M: Reborrow,
M::Target: AsStorage<ArcPayload<G>> + Consistent,
G: GraphGeometry,
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]
M: Reborrow,
M::Target: AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + Consistent,
G: GraphGeometry,
pub fn distance(
&self,
source: Selector<VertexKey>,
destination: Selector<VertexKey>
) -> Result<usize, GraphError>
[src]
&self,
source: Selector<VertexKey>,
destination: Selector<VertexKey>
) -> Result<usize, GraphError>
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]
&self
) -> impl Clone + Iterator<Item = VertexView<&M::Target, G>>
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]
M: Reborrow,
M::Target: AsStorage<ArcPayload<G>> + AsStorage<FacePayload<G>> + Consistent,
G: GraphGeometry,
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]
M: AsStorage<VertexPayload<G>> + AsStorage<ArcPayload<G>> + AsStorage<FacePayload<G>> + Default + Mutable<G>,
G: 'a + GraphGeometry,
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]
F: FnOnce() -> G::Face,
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]
M: Reborrow,
M::Target: AsStorage<ArcPayload<G>> + Consistent,
G: GraphGeometry,
fn into_arc(self) -> ArcView<M, G>
[src]
fn interior_arcs(&self) -> ArcCirculator<&M::Target, G>
[src]
fn vertices(&self) -> VertexCirculator<&M::Target, G> where
M::Target: AsStorage<VertexPayload<G>>,
[src]
M::Target: AsStorage<VertexPayload<G>>,
fn arity(&self) -> usize
[src]
fn distance(
&self,
source: Selector<VertexKey>,
destination: Selector<VertexKey>
) -> Result<usize, GraphError> where
M::Target: AsStorage<VertexPayload<G>>,
[src]
&self,
source: Selector<VertexKey>,
destination: Selector<VertexKey>
) -> Result<usize, GraphError> where
M::Target: AsStorage<VertexPayload<G>>,
impl<M, G> PartialEq<RingView<M, G>> for RingView<M, G> where
M: Reborrow,
M::Target: AsStorage<ArcPayload<G>> + Consistent,
G: GraphGeometry,
[src]
M: Reborrow,
M::Target: AsStorage<ArcPayload<G>> + Consistent,
G: GraphGeometry,
Auto Trait Implementations
impl<M, G> Send for RingView<M, G> where
M: Send,
M: Send,
impl<M, G> Sync for RingView<M, G> where
M: Sync,
M: Sync,
impl<M, G> Unpin for RingView<M, G> where
M: Unpin,
M: Unpin,
impl<M, G> UnwindSafe for RingView<M, G> where
M: UnwindSafe,
M: UnwindSafe,
impl<M, G> RefUnwindSafe for RingView<M, G> where
M: 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, 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>,