Trait SegmentedPath

Source
pub trait SegmentedPath<S: PathSegment + ?Sized>:
    Clone
    + Eq
    + Hash
    + Debug {
    // Required methods
    fn segments(&self) -> Box<dyn Iterator<Item = &S> + '_>;
    fn parent_child_segments(
        &self,
    ) -> (Box<dyn Iterator<Item = &S> + '_>, Option<&S>);
}
Expand description

Decomposition of a path into segments.

Required Methods§

Source

fn segments(&self) -> Box<dyn Iterator<Item = &S> + '_>

Iterate over all path segments.

All segments are guaranteed to be non-empty.

Source

fn parent_child_segments( &self, ) -> (Box<dyn Iterator<Item = &S> + '_>, Option<&S>)

Split the path into parent segments and the last child segment.

The returned iterator excludes the last segment that is included by Self::segments().

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§