Type Alias ObjectStorePath

Source
pub type ObjectStorePath = Path;

Aliased Type§

struct ObjectStorePath { /* private fields */ }

Implementations

Source§

impl Path

Source

pub fn parse(path: impl AsRef<str>) -> Result<Path, Error>

Parse a string as a Path, returning a Error if invalid, as defined on the docstring for Path

Note: this will strip any leading / or trailing /

Source

pub fn from_filesystem_path(path: impl AsRef<Path>) -> Result<Path, Error>

Convert a filesystem path to a Path relative to the filesystem root

This will return an error if the path contains illegal character sequences as defined on the docstring for Path or does not exist

Note: this will canonicalize the provided path, resolving any symlinks

Source

pub fn from_absolute_path(path: impl AsRef<Path>) -> Result<Path, Error>

Convert an absolute filesystem path to a Path relative to the filesystem root

This will return an error if the path contains illegal character sequences, as defined on the docstring for Path, or base is not an absolute path

Source

pub fn from_url_path(path: impl AsRef<str>) -> Result<Path, Error>

Parse a url encoded string as a Path, returning a Error if invalid

This will return an error if the path contains illegal character sequences as defined on the docstring for Path

Source

pub fn parts(&self) -> impl Iterator<Item = PathPart<'_>>

Returns the PathPart of this Path

Source

pub fn filename(&self) -> Option<&str>

Returns the last path segment containing the filename stored in this Path

Source

pub fn extension(&self) -> Option<&str>

Returns the extension of the file stored in this Path, if any

Source

pub fn prefix_match( &self, prefix: &Path, ) -> Option<impl Iterator<Item = PathPart<'_>>>

Returns an iterator of the PathPart of this Path after prefix

Returns None if the prefix does not match

Source

pub fn prefix_matches(&self, prefix: &Path) -> bool

Returns true if this Path starts with prefix

Source

pub fn child<'a>(&self, child: impl Into<PathPart<'a>>) -> Path

Creates a new child of this Path

Trait Implementations

Source§

impl AsRef<str> for Path

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for Path

Source§

fn clone(&self) -> Path

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Path

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Path

Source§

fn default() -> Path

Returns the “default value” for a type. Read more
Source§

impl Display for Path

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<&str> for Path

Source§

fn from(path: &str) -> Path

Converts to this type from the input type.
Source§

impl From<String> for Path

Source§

fn from(path: String) -> Path

Converts to this type from the input type.
Source§

impl<'a, I> FromIterator<I> for Path
where I: Into<PathPart<'a>>,

Source§

fn from_iter<T>(iter: T) -> Path
where T: IntoIterator<Item = I>,

Creates a value from an iterator. Read more
Source§

impl Hash for Path

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Path

Source§

fn cmp(&self, other: &Path) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Path

Source§

fn eq(&self, other: &Path) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Path

Source§

fn partial_cmp(&self, other: &Path) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for Path

Source§

impl StructuralPartialEq for Path