InteriorPathView

Struct InteriorPathView 

Source
pub struct InteriorPathView<M, G>
where M: Reborrow, M::Target: AsStorage<ArcPayload<G>> + Consistent, G: Geometry,
{ /* private fields */ }
Expand description

View of an interior path.

Interior paths 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.

Interior paths have no associated payload and do not directly expose geometry.

See the module documentation for more information about topological views.

Implementations§

Source§

impl<'a, M, G> InteriorPathView<&'a mut M, G>
where M: AsStorage<ArcPayload<G>> + Consistent, G: 'a + Geometry,

Source

pub fn into_ref(self) -> InteriorPathView<&'a M, G>

Converts a mutable view into an immutable view.

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

Source

pub fn with_ref<T, K, F>(self, f: F) -> Either<Result<T, GraphError>, Self>
where T: FromKeyedSource<(K, &'a mut M)>, F: FnOnce(InteriorPathView<&M, G>) -> Option<K>,

Reborrows the view and constructs another mutable view from a given key.

This allows for fallible traversals from a mutable view without the need for direct access to the source MeshGraph. If the given function emits a key, then that key will be used to convert this view into another. If no key is emitted, then the original mutable view is returned.

Source§

impl<M, G> InteriorPathView<M, G>
where M: Reborrow, M::Target: AsStorage<ArcPayload<G>> + Consistent, G: Geometry,

Source

pub fn arity(&self) -> usize

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

Source

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

Gets an iterator of views over the arcs within the interior path.

Source§

impl<M, G> InteriorPathView<M, G>
where M: Reborrow, M::Target: AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + Consistent, G: Geometry,

Source

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

Converts the interior path into its originating arc.

Source

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

Gets the originating arc of the interior path.

Source

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

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

Source

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

Gets an iterator of views over the vertices within the interior path.

Source§

impl<M, G> InteriorPathView<M, G>
where M: Reborrow, M::Target: AsStorage<ArcPayload<G>> + AsStorage<FacePayload<G>> + Consistent, G: Geometry,

Source

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

Converts the interior path into its face.

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

Source

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

Gets the face of the interior path.

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

Source§

impl<'a, M, G> InteriorPathView<&'a mut M, G>
where M: AsStorage<VertexPayload<G>> + AsStorage<ArcPayload<G>> + AsStorage<FacePayload<G>> + Default + Mutable<G>, G: 'a + Geometry,

Source

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

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

Returns the inserted face.

Source

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

Gets the face of the interior path 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.

Auto Trait Implementations§

§

impl<M, G> Freeze for InteriorPathView<M, G>
where M: Freeze,

§

impl<M, G> RefUnwindSafe for InteriorPathView<M, G>

§

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

§

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

§

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

§

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

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromGeometry<T> for T

Source§

fn from_geometry(other: T) -> T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> IntoGeometry<U> for T
where U: FromGeometry<T>,

Source§

fn into_geometry(self) -> U

Source§

impl<T, U> IntoInteriorGeometry<U> for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

unsafe fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.