pub struct FilePathSegments<'a>(/* private fields */);Expand description
One or more FilePathSegments.
Please note that single and double dot segments are not resolved until placed into a FilePath.
§Examples
use better_url::prelude::*;
let segments = FilePathSegments::new("abc/def/../ghi");
assert_eq!(segments, "abc/def/../ghi");
let path = FilePath::new(segments);
assert_eq!(path, "/abc/ghi");Implementations§
Source§impl<'a> FilePathSegments<'a>
impl<'a> FilePathSegments<'a>
Sourcepub unsafe fn new_unchecked<T: Into<Cow<'a, str>>>(value: T) -> Self
pub unsafe fn new_unchecked<T: Into<Cow<'a, str>>>(value: T) -> Self
Sourcepub fn iter(&self) -> FilePathSegmentsIter<'_> ⓘ
pub fn iter(&self) -> FilePathSegmentsIter<'_> ⓘ
The FilePathSegmentsIter.
Sourcepub fn get(&self, index: isize) -> Option<FilePathSegment<'_>>
pub fn get(&self, index: isize) -> Option<FilePathSegment<'_>>
The indexth FilePathSegment.
Sourcepub fn into_inner(self) -> Cow<'a, str>
pub fn into_inner(self) -> Cow<'a, str>
Turn into the inner Cow.
Sourcepub fn into_owned(self) -> FilePathSegments<'static>
pub fn into_owned(self) -> FilePathSegments<'static>
Turn into an owned Self.
Sourcepub fn borrowed(&self) -> FilePathSegments<'_>
pub fn borrowed(&self) -> FilePathSegments<'_>
Make a borrowing Self.
Source§impl<'a> FilePathSegments<'a>
impl<'a> FilePathSegments<'a>
Trait Implementations§
Source§impl AsRef<str> for FilePathSegments<'_>
impl AsRef<str> for FilePathSegments<'_>
Source§impl Borrow<str> for FilePathSegments<'_>
impl Borrow<str> for FilePathSegments<'_>
Source§impl<'a> Clone for FilePathSegments<'a>
impl<'a> Clone for FilePathSegments<'a>
Source§impl<'a> Debug for FilePathSegments<'a>
impl<'a> Debug for FilePathSegments<'a>
Source§impl Display for FilePathSegments<'_>
impl Display for FilePathSegments<'_>
impl Eq for FilePathSegments<'_>
Source§impl<'a, 'b> Extend<FilePathSegment<'b>> for FilePathSegments<'a>
impl<'a, 'b> Extend<FilePathSegment<'b>> for FilePathSegments<'a>
Source§fn extend<I: IntoIterator<Item = FilePathSegment<'b>>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = FilePathSegment<'b>>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<'a> From<&'a FilePathSegment<'_>> for FilePathSegments<'a>
impl<'a> From<&'a FilePathSegment<'_>> for FilePathSegments<'a>
Source§fn from(value: &'a FilePathSegment<'_>) -> Self
fn from(value: &'a FilePathSegment<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a FilePathSegments<'_>> for PathSegments<'a>
impl<'a> From<&'a FilePathSegments<'_>> for PathSegments<'a>
Source§fn from(value: &'a FilePathSegments<'_>) -> Self
fn from(value: &'a FilePathSegments<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a FilePathSegments<'_>> for FilePathSegments<'a>
impl<'a> From<&'a FilePathSegments<'_>> for FilePathSegments<'a>
Source§fn from(value: &'a FilePathSegments<'_>) -> Self
fn from(value: &'a FilePathSegments<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a FilePathSegments<'_>> for SpecialNotFilePathSegments<'a>
impl<'a> From<&'a FilePathSegments<'_>> for SpecialNotFilePathSegments<'a>
Source§fn from(value: &'a FilePathSegments<'_>) -> Self
fn from(value: &'a FilePathSegments<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a FilePathSegments<'_>> for NonSpecialPathSegments<'a>
impl<'a> From<&'a FilePathSegments<'_>> for NonSpecialPathSegments<'a>
Source§fn from(value: &'a FilePathSegments<'_>) -> Self
fn from(value: &'a FilePathSegments<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a NonSpecialPathSegment<'_>> for FilePathSegments<'a>
impl<'a> From<&'a NonSpecialPathSegment<'_>> for FilePathSegments<'a>
Source§fn from(value: &'a NonSpecialPathSegment<'_>) -> Self
fn from(value: &'a NonSpecialPathSegment<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a NonSpecialPathSegments<'_>> for FilePathSegments<'a>
impl<'a> From<&'a NonSpecialPathSegments<'_>> for FilePathSegments<'a>
Source§fn from(value: &'a NonSpecialPathSegments<'_>) -> Self
fn from(value: &'a NonSpecialPathSegments<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PathSegment<'_>> for FilePathSegments<'a>
impl<'a> From<&'a PathSegment<'_>> for FilePathSegments<'a>
Source§fn from(value: &'a PathSegment<'_>) -> Self
fn from(value: &'a PathSegment<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PathSegments<'_>> for FilePathSegments<'a>
impl<'a> From<&'a PathSegments<'_>> for FilePathSegments<'a>
Source§fn from(value: &'a PathSegments<'_>) -> Self
fn from(value: &'a PathSegments<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a SpecialNotFilePathSegment<'_>> for FilePathSegments<'a>
impl<'a> From<&'a SpecialNotFilePathSegment<'_>> for FilePathSegments<'a>
Source§fn from(value: &'a SpecialNotFilePathSegment<'_>) -> Self
fn from(value: &'a SpecialNotFilePathSegment<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a SpecialNotFilePathSegments<'_>> for FilePathSegments<'a>
impl<'a> From<&'a SpecialNotFilePathSegments<'_>> for FilePathSegments<'a>
Source§fn from(value: &'a SpecialNotFilePathSegments<'_>) -> Self
fn from(value: &'a SpecialNotFilePathSegments<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a String> for FilePathSegments<'a>
impl<'a> From<&'a String> for FilePathSegments<'a>
Source§impl<'a> From<&'a [u8]> for FilePathSegments<'a>
impl<'a> From<&'a [u8]> for FilePathSegments<'a>
Source§impl<'a> From<&'a str> for FilePathSegments<'a>
impl<'a> From<&'a str> for FilePathSegments<'a>
Source§impl<'a> From<FilePathSegment<'a>> for FilePathSegments<'a>
impl<'a> From<FilePathSegment<'a>> for FilePathSegments<'a>
Source§fn from(value: FilePathSegment<'a>) -> Self
fn from(value: FilePathSegment<'a>) -> Self
Converts to this type from the input type.
Source§impl From<FilePathSegments<'_>> for FilePath<'static>
impl From<FilePathSegments<'_>> for FilePath<'static>
Source§fn from(value: FilePathSegments<'_>) -> Self
fn from(value: FilePathSegments<'_>) -> Self
Converts to this type from the input type.
Source§impl From<FilePathSegments<'_>> for SpecialNotFilePath<'static>
impl From<FilePathSegments<'_>> for SpecialNotFilePath<'static>
Source§fn from(value: FilePathSegments<'_>) -> Self
fn from(value: FilePathSegments<'_>) -> Self
Converts to this type from the input type.
Source§impl From<FilePathSegments<'_>> for NonSpecialPath<'static>
impl From<FilePathSegments<'_>> for NonSpecialPath<'static>
Source§fn from(value: FilePathSegments<'_>) -> Self
fn from(value: FilePathSegments<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<FilePathSegments<'a>> for PathSegments<'a>
impl<'a> From<FilePathSegments<'a>> for PathSegments<'a>
Source§fn from(value: FilePathSegments<'a>) -> Self
fn from(value: FilePathSegments<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<FilePathSegments<'a>> for SpecialNotFilePathSegments<'a>
impl<'a> From<FilePathSegments<'a>> for SpecialNotFilePathSegments<'a>
Source§fn from(value: FilePathSegments<'a>) -> Self
fn from(value: FilePathSegments<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<FilePathSegments<'a>> for NonSpecialPathSegments<'a>
impl<'a> From<FilePathSegments<'a>> for NonSpecialPathSegments<'a>
Source§fn from(value: FilePathSegments<'a>) -> Self
fn from(value: FilePathSegments<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<NonSpecialPathSegment<'a>> for FilePathSegments<'a>
impl<'a> From<NonSpecialPathSegment<'a>> for FilePathSegments<'a>
Source§fn from(value: NonSpecialPathSegment<'a>) -> Self
fn from(value: NonSpecialPathSegment<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<NonSpecialPathSegments<'a>> for FilePathSegments<'a>
impl<'a> From<NonSpecialPathSegments<'a>> for FilePathSegments<'a>
Source§fn from(value: NonSpecialPathSegments<'a>) -> Self
fn from(value: NonSpecialPathSegments<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PathSegment<'a>> for FilePathSegments<'a>
impl<'a> From<PathSegment<'a>> for FilePathSegments<'a>
Source§fn from(value: PathSegment<'a>) -> Self
fn from(value: PathSegment<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PathSegments<'a>> for FilePathSegments<'a>
impl<'a> From<PathSegments<'a>> for FilePathSegments<'a>
Source§fn from(value: PathSegments<'a>) -> Self
fn from(value: PathSegments<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<SpecialNotFilePathSegment<'a>> for FilePathSegments<'a>
impl<'a> From<SpecialNotFilePathSegment<'a>> for FilePathSegments<'a>
Source§fn from(value: SpecialNotFilePathSegment<'a>) -> Self
fn from(value: SpecialNotFilePathSegment<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<SpecialNotFilePathSegments<'a>> for FilePathSegments<'a>
impl<'a> From<SpecialNotFilePathSegments<'a>> for FilePathSegments<'a>
Source§fn from(value: SpecialNotFilePathSegments<'a>) -> Self
fn from(value: SpecialNotFilePathSegments<'a>) -> Self
Converts to this type from the input type.
Source§impl From<String> for FilePathSegments<'static>
impl From<String> for FilePathSegments<'static>
Source§impl FromStr for FilePathSegments<'static>
impl FromStr for FilePathSegments<'static>
Source§impl Hash for FilePathSegments<'_>
impl Hash for FilePathSegments<'_>
Source§impl<'a> IntoIterator for &'a FilePathSegments<'_>
impl<'a> IntoIterator for &'a FilePathSegments<'_>
Source§impl Ord for FilePathSegments<'_>
impl Ord for FilePathSegments<'_>
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 PartialEq<&str> for FilePathSegments<'_>
impl PartialEq<&str> for FilePathSegments<'_>
Source§impl PartialEq<FilePathSegment<'_>> for FilePathSegments<'_>
impl PartialEq<FilePathSegment<'_>> for FilePathSegments<'_>
Source§impl PartialEq<FilePathSegments<'_>> for FilePathSegment<'_>
impl PartialEq<FilePathSegments<'_>> for FilePathSegment<'_>
Source§impl PartialEq<FilePathSegments<'_>> for NonSpecialPathSegment<'_>
impl PartialEq<FilePathSegments<'_>> for NonSpecialPathSegment<'_>
Source§impl PartialEq<FilePathSegments<'_>> for str
impl PartialEq<FilePathSegments<'_>> for str
Source§impl PartialEq<FilePathSegments<'_>> for &str
impl PartialEq<FilePathSegments<'_>> for &str
Source§impl PartialEq<FilePathSegments<'_>> for String
impl PartialEq<FilePathSegments<'_>> for String
Source§impl PartialEq<FilePathSegments<'_>> for FilePathSegments<'_>
impl PartialEq<FilePathSegments<'_>> for FilePathSegments<'_>
Source§impl PartialEq<NonSpecialPathSegment<'_>> for FilePathSegments<'_>
impl PartialEq<NonSpecialPathSegment<'_>> for FilePathSegments<'_>
Source§impl PartialEq<String> for FilePathSegments<'_>
impl PartialEq<String> for FilePathSegments<'_>
Source§impl PartialEq<str> for FilePathSegments<'_>
impl PartialEq<str> for FilePathSegments<'_>
Source§impl PartialOrd<&str> for FilePathSegments<'_>
impl PartialOrd<&str> for FilePathSegments<'_>
Source§impl PartialOrd<Cow<'_, str>> for FilePathSegments<'_>
impl PartialOrd<Cow<'_, str>> for FilePathSegments<'_>
Source§impl PartialOrd<FilePathSegment<'_>> for FilePathSegments<'_>
impl PartialOrd<FilePathSegment<'_>> for FilePathSegments<'_>
Source§impl PartialOrd<FilePathSegments<'_>> for FilePathSegment<'_>
impl PartialOrd<FilePathSegments<'_>> for FilePathSegment<'_>
Source§impl PartialOrd<FilePathSegments<'_>> for NonSpecialPathSegment<'_>
impl PartialOrd<FilePathSegments<'_>> for NonSpecialPathSegment<'_>
Source§impl PartialOrd<FilePathSegments<'_>> for str
impl PartialOrd<FilePathSegments<'_>> for str
Source§impl PartialOrd<FilePathSegments<'_>> for &str
impl PartialOrd<FilePathSegments<'_>> for &str
Source§impl PartialOrd<FilePathSegments<'_>> for String
impl PartialOrd<FilePathSegments<'_>> for String
Source§impl PartialOrd<FilePathSegments<'_>> for Cow<'_, str>
impl PartialOrd<FilePathSegments<'_>> for Cow<'_, str>
Source§impl PartialOrd<FilePathSegments<'_>> for FilePathSegments<'_>
impl PartialOrd<FilePathSegments<'_>> for FilePathSegments<'_>
Source§impl PartialOrd<NonSpecialPathSegment<'_>> for FilePathSegments<'_>
impl PartialOrd<NonSpecialPathSegment<'_>> for FilePathSegments<'_>
Source§impl PartialOrd<String> for FilePathSegments<'_>
impl PartialOrd<String> for FilePathSegments<'_>
Source§impl PartialOrd<str> for FilePathSegments<'_>
impl PartialOrd<str> for FilePathSegments<'_>
Auto Trait Implementations§
impl<'a> Freeze for FilePathSegments<'a>
impl<'a> RefUnwindSafe for FilePathSegments<'a>
impl<'a> Send for FilePathSegments<'a>
impl<'a> Sync for FilePathSegments<'a>
impl<'a> Unpin for FilePathSegments<'a>
impl<'a> UnsafeUnpin for FilePathSegments<'a>
impl<'a> UnwindSafe for FilePathSegments<'a>
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