Skip to main content

Path

Struct Path 

Source
pub struct Path(/* 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

Source

pub const ROOT: &'static Path

Source

pub const EMPTY: &'static Path

Source

pub const SYSTEM: &'static Path

Operating-system code and account records.

Source

pub const SYSTEM_ACCOUNTS: &'static Path

Source

pub const SYSTEM_ACCOUNT_USERS: &'static Path

Source

pub const SYSTEM_ACCOUNT_GROUPS: &'static Path

Source

pub const SYSTEM_EXECUTABLES: &'static Path

Source

pub const SYSTEM_LIBRARIES: &'static Path

Source

pub const SYSTEM_SERVICES: &'static Path

Source

pub const DEVICES: &'static Path

Runtime device endpoints grouped by function.

Source

pub const NETWORK_DEVICES: &'static Path

Source

pub const BLUETOOTH_DEVICES: &'static Path

Source

pub const AUDIO_DEVICES: &'static Path

Source

pub const COMPUTE_DEVICES: &'static Path

Source

pub const GRAPHICS_DEVICES: &'static Path

Source

pub const INPUT_DEVICES: &'static Path

Source

pub const RANDOM_DEVICES: &'static Path

Source

pub const STANDARD_IO_DEVICES: &'static Path

Source

pub const STORAGE_DEVICES: &'static Path

Source

pub const TIME_DEVICES: &'static Path

Source

pub const UART_DEVICES: &'static Path

Peripheral device nodes: /devices/<class>/<name>, e.g. /devices/uart/uart0.

Source

pub const I2C_DEVICES: &'static Path

Source

pub const SPI_DEVICES: &'static Path

Source

pub const ADC_DEVICES: &'static Path

Source

pub const GPIO_DEVICES: &'static Path

Source

pub const PWM_DEVICES: &'static Path

Source

pub const HUMAN_INTERFACE_DEVICES: &'static Path

Source

pub const REAL_TIME_CLOCK: &'static Path

Real-time clock node holding wall-clock time (UTC) across resets.

Source

pub const CONFIGURATION: &'static Path

System and application configuration.

Source

pub const SYSTEM_CONFIGURATION: &'static Path

Source

pub const PACKAGE_CONFIGURATION: &'static Path

Package installation policy, such as the trusted repository key.

Source

pub const APPLICATION_CONFIGURATION: &'static Path

Source

pub const SHARED_CONFIGURATION: &'static Path

Source

pub const APPLICATIONS: &'static Path

Installed application code.

Source

pub const APPLICATION_EXECUTABLES: &'static Path

Source

pub const APPLICATION_LIBRARIES: &'static Path

Source

pub const APPLICATION_BUNDLES: &'static Path

Installed self-contained application bundles: /applications/bundles/<package-id>/, each the extracted .xpk archive (.xila/, executables/, resources, shortcut.json).

Source

pub const DATA: &'static Path

Mutable persistent state.

Source

pub const SYSTEM_DATA: &'static Path

Source

pub const SYSTEM_CRASHES: &'static Path

Source

pub const SYSTEM_LOGS: &'static Path

Source

pub const APPLICATION_DATA: &'static Path

Source

pub const SHARED_DATA: &'static Path

Source

pub const USERS: &'static Path

User homes.

Source

pub const TEMPORARY: &'static Path

Scratch storage cleared at boot.

Source

pub const TEMPORARY_CACHE: &'static Path

Source

pub const TEMPORARY_SESSIONS: &'static Path

Source

pub const fn from_str(path: &str) -> &Path

§Safety

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

Source

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

§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>

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<PathOwned>

Source

pub fn strip_prefix<'b>(&'b self, path_prefix: &Path) -> Option<&'b Path>

Source

pub fn strip_prefix_absolute<'b>( &'b self, path_prefix: &Path, ) -> Option<&'b Path>

Source

pub fn strip_suffix<'b>(&'b self, path_suffix: &Path) -> Option<&'b Path>

Source

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

Source

pub fn join(&self, path: impl AsRef<Path>) -> Option<PathOwned>

Source

pub fn append(&self, path: &str) -> Option<PathOwned>

Source

pub fn get_length(&self) -> usize

Source

pub fn as_str(&self) -> &str

Trait Implementations§

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 PathOwned

Source§

fn as_ref(&self) -> &Path

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

impl AsRef<Path> for str

Source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
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 Borrow<Path> for PathOwned

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 Hash for Path

Source§

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

Feeds this value into the given Hasher. 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 (const: unstable) · 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

Source§

type Owned = PathOwned

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

Source§

impl StructuralPartialEq 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 UnsafeUnpin 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