pub struct SanitizedPath(/* private fields */);Expand description
In memory, this is identical to Path. On non-Windows conversions to this type are no-ops. On
windows, these conversions sanitize UNC paths by removing the \\\\?\\ prefix.
Implementations§
Source§impl SanitizedPath
impl SanitizedPath
pub fn new<T: AsRef<Path> + ?Sized>(path: &T) -> &Self
pub fn unchecked_new<T: AsRef<Path> + ?Sized>(path: &T) -> &Self
pub fn from_arc(path: Arc<Path>) -> Arc<Self>
pub fn new_arc<T: AsRef<Path> + ?Sized>(path: &T) -> Arc<Self>
pub fn cast_arc(path: Arc<Self>) -> Arc<Path>
pub fn cast_arc_ref(path: &Arc<Self>) -> &Arc<Path>
pub fn starts_with(&self, prefix: &Self) -> bool
pub fn as_path(&self) -> &Path
pub fn file_name(&self) -> Option<&OsStr>
pub fn extension(&self) -> Option<&OsStr>
pub fn join<P: AsRef<Path>>(&self, path: P) -> PathBuf
pub fn parent(&self) -> Option<&Self>
pub fn strip_prefix(&self, base: &Self) -> Result<&Path, StripPrefixError>
pub fn to_str(&self) -> Option<&str>
pub fn to_path_buf(&self) -> PathBuf
Trait Implementations§
Source§impl AsRef<Path> for SanitizedPath
impl AsRef<Path> for SanitizedPath
Source§impl Debug for SanitizedPath
impl Debug for SanitizedPath
Source§impl Display for SanitizedPath
impl Display for SanitizedPath
Source§impl From<&SanitizedPath> for Arc<SanitizedPath>
impl From<&SanitizedPath> for Arc<SanitizedPath>
Source§fn from(sanitized_path: &SanitizedPath) -> Self
fn from(sanitized_path: &SanitizedPath) -> Self
Converts to this type from the input type.
Source§impl From<&SanitizedPath> for PathBuf
impl From<&SanitizedPath> for PathBuf
Source§fn from(sanitized_path: &SanitizedPath) -> Self
fn from(sanitized_path: &SanitizedPath) -> Self
Converts to this type from the input type.
Source§impl Hash for SanitizedPath
impl Hash for SanitizedPath
Source§impl Ord for SanitizedPath
impl Ord for SanitizedPath
Source§impl PartialEq for SanitizedPath
impl PartialEq for SanitizedPath
Source§impl PartialOrd for SanitizedPath
impl PartialOrd for SanitizedPath
impl Eq for SanitizedPath
impl StructuralPartialEq for SanitizedPath
Auto Trait Implementations§
impl Freeze for SanitizedPath
impl RefUnwindSafe for SanitizedPath
impl Send for SanitizedPath
impl !Sized for SanitizedPath
impl Sync for SanitizedPath
impl Unpin for SanitizedPath
impl UnwindSafe for SanitizedPath
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
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.