File_system

Struct Path_type

Source
pub struct Path_type(/* private fields */);
Expand description

A borrowed path type. The implementation is very similar to the standard library’s std::path::Path. However, this implementation is more lightweight and allows for std-less usage.

Implementations§

Source§

impl Path_type

Source

pub const Root: &'static Path_type = _

Source

pub const Empty: &'static Path_type = _

Source

pub const System: &'static Path_type = _

Contains the OS core, including the kernel, init system, and critical drivers. Prevents modification by regular users.

Source

pub const Devices: &'static Path_type = _

Stores system-wide settings in a structured format (e.g., JSON, TOML).

Source

pub const Configuration: &'static Path_type = _

Hardware devices, symlinks for human-friendly names.

Source

pub const Shared_configuration: &'static Path_type = _

Contains the shared configurations between applications.

Source

pub const Data: &'static Path_type = _

Binaries data.

Source

pub const Shared_data: &'static Path_type = _

Shared data between binaries.

Source

pub const Binaries: &'static Path_type = _

Contains the system’s binaries, including the shell and other executables.

Source

pub const Users: &'static Path_type = _

Contains the user’s data, including documents, downloads, and other files.

Source

pub const Temporary: &'static Path_type = _

Contains temporary files, including logs and caches.

Source

pub const Logs: &'static Path_type = _

Contains logs, including system logs and application logs.

Source

pub const fn From_str(Path: &str) -> &Path_type

§Safety

The caller must ensure that the string is a valid path string.

Source

pub fn New<S: AsRef<str> + ?Sized>(Path: &S) -> &Path_type

§Safety

The caller must ensure that the string is a valid path string.

Source

pub fn Is_valid(&self) -> bool

Source

pub fn Is_absolute(&self) -> bool

Source

pub fn Is_root(&self) -> bool

Source

pub fn Is_empty(&self) -> bool

Source

pub fn Is_canonical(&self) -> bool

Source

pub fn Go_parent(&self) -> Option<&Path_type>

Source

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

Source

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

Source

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

Source

pub fn Set_extension(&self, Extension: &str) -> Option<Path_owned_type>

Source

pub fn Strip_prefix<'b>( &'b self, Path_prefix: &Path_type, ) -> Option<&'b Path_type>

Source

pub fn Strip_prefix_absolute<'b>( &'b self, Path_prefix: &Path_type, ) -> Option<&'b Path_type>

Source

pub fn Strip_suffix<'b>( &'b self, Path_suffix: &Path_type, ) -> Option<&'b Path_type>

Source

pub fn Get_components(&self) -> Components_type<'_>

Source

pub fn Join(&self, Path: &Path_type) -> Option<Path_owned_type>

Source

pub fn Append(&self, Path: &str) -> Option<Path_owned_type>

Source

pub fn Get_length(&self) -> usize

Source

pub fn As_str(&self) -> &str

Trait Implementations§

Source§

impl AsRef<Path> for Path_type

Source§

fn as_ref(&self) -> &Path

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

impl AsRef<Path_type> for Path_owned_type

Source§

fn as_ref(&self) -> &Path_type

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

impl AsRef<Path_type> for Path_type

Source§

fn as_ref(&self) -> &Path_type

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

impl AsRef<Path_type> for str

Source§

fn as_ref(&self) -> &Path_type

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

impl AsRef<str> for &Path_type

Source§

fn as_ref(&self) -> &str

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

impl Borrow<Path_type> for Path_owned_type

Source§

fn borrow(&self) -> &Path_type

Immutably borrows from an owned value. Read more
Source§

impl Debug for Path_type

Source§

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

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

impl Hash for Path_type

Source§

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

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

impl PartialEq for Path_type

Source§

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

Source§

type Owned = Path_owned_type

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl Eq for Path_type

Source§

impl StructuralPartialEq for Path_type

Auto Trait Implementations§

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