pub struct PathOwned(/* private fields */);
Implementations§
Source§impl PathOwned
impl PathOwned
Sourcepub unsafe fn new_unchecked(path: String) -> Self
pub unsafe fn new_unchecked(path: String) -> Self
§Safety
The caller must ensure that the string is valid path string.
pub fn new(path: String) -> Option<Self>
pub fn root() -> PathOwned
pub fn join(self, path: impl AsRef<Path>) -> Option<Self>
pub fn append(self, path: &str) -> Option<Self>
pub fn revert_parent_directory(&mut self) -> &mut Self
pub fn get_extension(&self) -> Option<&str>
pub fn get_file_name(&self) -> &str
pub fn get_relative_to(&self, path: &PathOwned) -> Option<PathOwned>
pub fn canonicalize(self) -> Self
Methods from Deref<Target = Path>§
pub const ROOT: &'static Path
pub const EMPTY: &'static Path
pub const SYSTEM: &'static Path
pub const DEVICES: &'static Path
pub const CONFIGURATION: &'static Path
pub const SHARED_CONFIGURATION: &'static Path
pub const DATA: &'static Path
pub const SHARED_DATA: &'static Path
pub const BINARIES: &'static Path
pub const USERS: &'static Path
pub const TEMPORARY: &'static Path
pub const LOGS: &'static Path
pub fn is_valid(&self) -> bool
pub fn is_absolute(&self) -> bool
pub fn is_root(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn is_canonical(&self) -> bool
pub fn go_parent(&self) -> Option<&Path>
pub fn get_file_prefix(&self) -> Option<&str>
pub fn get_file_name(&self) -> Option<&str>
pub fn get_extension(&self) -> Option<&str>
pub fn set_extension(&self, extension: &str) -> Option<PathOwned>
pub fn strip_prefix<'b>(&'b self, path_prefix: &Path) -> Option<&'b Path>
pub fn strip_prefix_absolute<'b>( &'b self, path_prefix: &Path, ) -> Option<&'b Path>
pub fn strip_suffix<'b>(&'b self, path_suffix: &Path) -> Option<&'b Path>
pub fn get_components(&self) -> Components<'_> ⓘ
pub fn join(&self, path: &Path) -> Option<PathOwned>
pub fn append(&self, path: &str) -> Option<PathOwned>
pub fn get_length(&self) -> usize
pub fn as_str(&self) -> &str
Trait Implementations§
impl Eq for PathOwned
impl StructuralPartialEq for PathOwned
Auto Trait Implementations§
impl Freeze for PathOwned
impl RefUnwindSafe for PathOwned
impl Send for PathOwned
impl Sync for PathOwned
impl Unpin for PathOwned
impl UnwindSafe for PathOwned
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