pub enum PathPlatform {
Windows,
Unix,
}Expand description
Which platform’s path syntax a string is judged against.
This exists so the rules are decided by an argument rather than by
cfg!(windows) at every branch. The Windows cases below — UNC, the device
namespace, drive-relative paths, reserved names — are the ones that motivate
this whole module, and a table that only ran its Windows half on Windows
would not be one table, it would be two half-tested ones.
Variants§
Implementations§
Source§impl PathPlatform
impl PathPlatform
Sourcepub const NATIVE: Self
pub const NATIVE: Self
The platform this build runs on, and the only one
LocalAbsolutePath::new accepts.
Sourcepub const fn is_separator(self, c: char) -> bool
pub const fn is_separator(self, c: char) -> bool
Windows accepts both separators on input; Unix accepts only /, because
a backslash is an ordinary character in a Unix file name.
Trait Implementations§
Source§impl Clone for PathPlatform
impl Clone for PathPlatform
Source§fn clone(&self) -> PathPlatform
fn clone(&self) -> PathPlatform
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PathPlatform
Source§impl Debug for PathPlatform
impl Debug for PathPlatform
Source§impl<'de> Deserialize<'de> for PathPlatform
impl<'de> Deserialize<'de> for PathPlatform
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PathPlatform
impl Display for PathPlatform
impl Eq for PathPlatform
Source§impl Hash for PathPlatform
impl Hash for PathPlatform
Source§impl Ord for PathPlatform
impl Ord for PathPlatform
Source§fn cmp(&self, other: &PathPlatform) -> Ordering
fn cmp(&self, other: &PathPlatform) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for PathPlatform
impl PartialEq for PathPlatform
Source§impl PartialOrd for PathPlatform
impl PartialOrd for PathPlatform
Source§impl Serialize for PathPlatform
impl Serialize for PathPlatform
impl StructuralPartialEq for PathPlatform
Auto Trait Implementations§
impl Freeze for PathPlatform
impl RefUnwindSafe for PathPlatform
impl Send for PathPlatform
impl Sync for PathPlatform
impl Unpin for PathPlatform
impl UnsafeUnpin for PathPlatform
impl UnwindSafe for PathPlatform
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