pub struct Segments(/* private fields */);Expand description
Names joined by /: a module path inside a library, a library’s root
inside its tree, or a file’s path inside its tree without its .flow.
The empty path is a library’s root module, or a tree’s own root.
No name is empty or holds a /: a path is read from its text
(FromStr) or made from its names
(from_names), and both refuse anything else.
Implementations§
Source§impl Segments
impl Segments
Sourcepub fn from_names<I>(names: I) -> Option<Segments>
pub fn from_names<I>(names: I) -> Option<Segments>
The path of names, in order; None when a name is empty or holds
a /, which no path’s name does.
Sourcepub fn join(&self, rest: &Segments) -> Segments
pub fn join(&self, rest: &Segments) -> Segments
rest under this path, either of which may be empty.
Sourcepub fn split_at(&self, length: usize) -> (Segments, Segments)
pub fn split_at(&self, length: usize) -> (Segments, Segments)
Its first length names and the rest; all of it and the empty path
when it has no more than length names.
Sourcepub fn strip_prefix(&self, prefix: &Segments) -> Option<Segments>
pub fn strip_prefix(&self, prefix: &Segments) -> Option<Segments>
This path with prefix and the / after it taken off its front;
None when it does not start with prefix’s names.
Trait Implementations§
impl Eq for Segments
Source§impl Ord for Segments
impl Ord for Segments
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Segments
impl PartialOrd for Segments
impl StructuralPartialEq for Segments
Auto Trait Implementations§
impl Forget for Segments
impl Freeze for Segments
impl Move for Segments
impl RefUnwindSafe for Segments
impl Send for Segmentswhere
RawVecInner: Send,
impl Sync for Segmentswhere
RawVecInner: Sync,
impl Unpin for Segments
impl UnsafeUnpin for Segments
impl UnwindSafe for Segmentswhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more