pub struct Ring<B> where
B: Reborrow,
B::Target: AsStorage<Arc<<B as Parametric>::Data>> + Consistent + Parametric, { /* private fields */ }
Expand description
Closed path formed by adjacent arcs.
Rings are closed paths formed by arcs and their immediately adjacent arcs. In a consistent graph, every arc forms such a path. Such paths may or may not be occupied by faces.
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\}}$.
Implementations
sourceimpl<B, M, G> Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, M, G> Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourceimpl<'a, B, M, G> Ring<B> where
B: ReborrowInto<'a, Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<'a, B, M, G> Ring<B> where
B: ReborrowInto<'a, Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourceimpl<B, M, G> Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, M, G> Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourceimpl<B, M, G> Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + AsStorage<Vertex<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, M, G> Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + AsStorage<Vertex<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
pub fn into_path(self) -> Path<'static, B>
pub fn path(&self) -> Path<'static, &M>
sourcepub fn shortest_logical_metric(
&self,
from: impl Into<Selector<VertexKey>>,
to: impl Into<Selector<VertexKey>>
) -> Result<usize, GraphError>
pub fn shortest_logical_metric(
&self,
from: impl Into<Selector<VertexKey>>,
to: impl Into<Selector<VertexKey>>
) -> Result<usize, GraphError>
Gets the shortest logical metric between vertices within the ring.
The logical metric assigns the unit weight (one) to every arc and effectively counts the number of arcs between vertices. In a closed path like a ring, there are two sub-paths between any two vertices. This function computes the metric of the shortest sub-path. This may be the null path with a zero metric.
sourceimpl<B, M, G> Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + AsStorage<Face<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, M, G> Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + AsStorage<Face<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourceimpl<'a, B, M, G> Ring<B> where
B: ReborrowInto<'a, Target = M>,
M: 'a + AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<'a, B, M, G> Ring<B> where
B: ReborrowInto<'a, Target = M>,
M: 'a + AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourceimpl<B, G> Ring<B> where
B: Reborrow,
B::Target: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, G> Ring<B> where
B: Reborrow,
B::Target: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourceimpl<'a, B, M, G> Ring<B> where
B: ReborrowInto<'a, Target = M>,
M: 'a + AsStorage<Arc<G>> + AsStorage<Vertex<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<'a, B, M, G> Ring<B> where
B: ReborrowInto<'a, Target = M>,
M: 'a + AsStorage<Arc<G>> + AsStorage<Vertex<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
pub fn into_vertices(self) -> impl Clone + Iterator<Item = VertexView<&'a M>>
sourceimpl<B, G> Ring<B> where
B: Reborrow,
B::Target: AsStorage<Arc<G>> + AsStorage<Vertex<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, G> Ring<B> where
B: Reborrow,
B::Target: AsStorage<Arc<G>> + AsStorage<Vertex<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourcepub fn vertices(&self) -> impl Clone + Iterator<Item = VertexView<&B::Target>>
pub fn vertices(&self) -> impl Clone + Iterator<Item = VertexView<&B::Target>>
Gets an iterator of views over the vertices within the ring.
sourceimpl<'a, M, G> Ring<&'a mut M> where
M: AsStorageMut<Arc<G>> + Consistent + Parametric<Data = G>,
G: 'a + GraphData,
impl<'a, M, G> Ring<&'a mut M> where
M: AsStorageMut<Arc<G>> + Consistent + Parametric<Data = G>,
G: 'a + GraphData,
pub fn into_arc_orphans(self) -> impl Iterator<Item = ArcOrphan<'a, G>>
sourceimpl<B> Ring<B> where
B: ReborrowMut,
B::Target: AsStorageMut<Arc<<B as Parametric>::Data>> + Consistent + Parametric,
impl<B> Ring<B> where
B: ReborrowMut,
B::Target: AsStorageMut<Arc<<B as Parametric>::Data>> + Consistent + Parametric,
sourcepub fn arc_orphans(
&mut self
) -> impl Iterator<Item = ArcOrphan<'_, <B as Parametric>::Data>>
pub fn arc_orphans(
&mut self
) -> impl Iterator<Item = ArcOrphan<'_, <B as Parametric>::Data>>
Gets an iterator of orphan views over the arcs in the ring.
sourceimpl<'a, M, G> Ring<&'a mut M> where
M: AsStorage<Arc<G>> + AsStorageMut<Vertex<G>> + Consistent + Parametric<Data = G>,
G: 'a + GraphData,
impl<'a, M, G> Ring<&'a mut M> where
M: AsStorage<Arc<G>> + AsStorageMut<Vertex<G>> + Consistent + Parametric<Data = G>,
G: 'a + GraphData,
pub fn into_vertex_orphans(self) -> impl Iterator<Item = VertexOrphan<'a, G>>
sourceimpl<B> Ring<B> where
B: ReborrowMut,
B::Target: AsStorage<Arc<<B as Parametric>::Data>> + AsStorageMut<Vertex<<B as Parametric>::Data>> + Consistent + Parametric,
impl<B> Ring<B> where
B: ReborrowMut,
B::Target: AsStorage<Arc<<B as Parametric>::Data>> + AsStorageMut<Vertex<<B as Parametric>::Data>> + Consistent + Parametric,
sourcepub fn vertex_orphans(
&mut self
) -> impl Iterator<Item = VertexOrphan<'_, <B as Parametric>::Data>>
pub fn vertex_orphans(
&mut self
) -> impl Iterator<Item = VertexOrphan<'_, <B as Parametric>::Data>>
Gets an iterator of views over the vertices within the ring.
sourceimpl<'a, M, G> Ring<&'a mut M> where
M: AsStorage<Vertex<G>> + AsStorage<Arc<G>> + AsStorage<Face<G>> + Default + Mutable<Data = G>,
G: GraphData,
impl<'a, M, G> Ring<&'a mut M> where
M: AsStorage<Vertex<G>> + AsStorage<Arc<G>> + AsStorage<Face<G>> + Default + Mutable<Data = G>,
G: GraphData,
sourcepub fn get_or_insert_face(self) -> FaceView<&'a mut M>
pub fn get_or_insert_face(self) -> FaceView<&'a mut M>
Gets the face of the ring or inserts a face if one does not already exist.
Returns the existing or inserted face.
sourcepub fn get_or_insert_face_with<F>(self, f: F) -> FaceView<&'a mut M> where
F: FnOnce() -> G::Face,
pub fn get_or_insert_face_with<F>(self, f: F) -> FaceView<&'a mut M> where
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 data for the face.
Returns the existing or inserted face.
Trait Implementations
sourceimpl<B, M, G> DynamicArity for Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, M, G> DynamicArity for Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourceimpl<B, M, G> From<ArcView<B>> for Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, M, G> From<ArcView<B>> for Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourceimpl<B, M, G> From<Ring<B>> for ArcView<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, M, G> From<Ring<B>> for ArcView<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourceimpl<B, M, G> From<Ring<B>> for Path<'static, B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + AsStorage<Vertex<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, M, G> From<Ring<B>> for Path<'static, B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + AsStorage<Vertex<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourceimpl<B, M, G> PartialEq<Ring<B>> for Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, M, G> PartialEq<Ring<B>> for Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
sourceimpl<B, M, G> StaticArity for Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
impl<B, M, G> StaticArity for Ring<B> where
B: Reborrow<Target = M>,
M: AsStorage<Arc<G>> + Consistent + Parametric<Data = G>,
G: GraphData,
Auto Trait Implementations
impl<B> RefUnwindSafe for Ring<B> where
B: RefUnwindSafe,
impl<B> Send for Ring<B> where
B: Send,
impl<B> Sync for Ring<B> where
B: Sync,
impl<B> Unpin for Ring<B> where
B: Unpin,
impl<B> UnwindSafe for Ring<B> where
B: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FromGeometry<T> for T
impl<T> FromGeometry<T> for T
fn from_geometry(other: T) -> T
sourceimpl<T, U> IntoGeometry<U> for T where
U: FromGeometry<T>,
impl<T, U> IntoGeometry<U> for T where
U: FromGeometry<T>,
fn into_geometry(self) -> U
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.