Path

Struct Path 

Source
pub struct Path(/* private fields */);
Available on crate feature alloc only.
Expand description

A path similar to the Path of the standard library, but based on CStr16 strings and SEPARATOR as separator.

Implementations§

Source§

impl Path

Source

pub fn new<S: AsRef<CStr16> + ?Sized>(s: &S) -> &Self

Constructor.

Source

pub const fn to_cstr16(&self) -> &CStr16

Returns the underlying string.

Source

pub fn to_path_buf(&self) -> PathBuf

Returns a path buf from that type.

Source

pub fn components(&self) -> Components<'_>

Iterator over the components of a path.

Source

pub fn parent(&self) -> Option<PathBuf>

Returns the parent directory as PathBuf.

If the path is a top-level component, this returns None.

Source

pub const fn is_empty(&self) -> bool

Returns of the path is empty.

Trait Implementations§

Source§

impl AsRef<CStr16> for Path

Source§

fn as_ref(&self) -> &CStr16

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

impl AsRef<Path> for &Path

Source§

fn as_ref(&self) -> &Path

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

impl AsRef<Path> for CStr16

Source§

fn as_ref(&self) -> &Path

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

impl AsRef<Path> for PathBuf

Source§

fn as_ref(&self) -> &Path

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

impl Borrow<CStr16> for Path

Source§

fn borrow(&self) -> &CStr16

Immutably borrows from an owned value. Read more
Source§

impl Borrow<Path> for CStr16

Source§

fn borrow(&self) -> &Path

Immutably borrows from an owned value. Read more
Source§

impl Borrow<Path> for PathBuf

Source§

fn borrow(&self) -> &Path

Immutably borrows from an owned value. Read more
Source§

impl Debug for Path

Source§

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

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

impl Display for Path

Source§

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

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

impl<'a> From<&'a CStr16> for &'a Path

Source§

fn from(value: &'a CStr16) -> Self

Converts to this type from the input type.
Source§

impl Ord for Path

Source§

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

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

impl PartialEq for Path

Source§

fn eq(&self, other: &Self) -> 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

Auto Trait Implementations§

§

impl Freeze for Path

§

impl RefUnwindSafe for Path

§

impl Send for Path

§

impl !Sized for Path

§

impl Sync for Path

§

impl Unpin for Path

§

impl UnwindSafe for Path

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more