#[non_exhaustive]pub enum PathModel {
Host,
Portable,
}Expand description
The path semantics an EntrySink is validated
against.
Host applies the rules of the platform running the extraction. On a
Windows host that means the component rules of Portable (every
character Windows refuses, reserved names, :, trailing dot or space);
on other hosts component names are not restricted.
Portable applies the strictest rules of every supported platform, on
every host, for a sink whose storage is read elsewhere:
- names fold as on macOS (canonical decomposition plus a case fold), so two spellings of one name are one name;
- a component with a backslash, one of
<>"|?*, a control character, a:, a trailing dot or space, a reserved Windows device name (unlesswindows_reserved_namesis allowed) or bytes that are not UTF-8 is refused; - a component is at most 255 and a path or symlink target at most 1023, counted in UTF-8 bytes and in UTF-16 units alike, and a symlink chain is cut off after 32 hops.
On a Windows host \ already separates the components of an entry
name when the path is parsed, so it is split there and not refused as a
backslash; every other host refuses it. Not modelled: 8.3 short names
and the legacy 260-unit MAX_PATH.
§Examples
use exarch_core::PathModel;
assert_eq!(PathModel::default(), PathModel::Host);
assert_eq!(PathModel::Portable.as_str(), "portable");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Host
The rules of the platform running the extraction.
Portable
The strictest rules of every supported platform.
Implementations§
Trait Implementations§
impl Copy for PathModel
impl Eq for PathModel
impl StructuralPartialEq for PathModel
Auto Trait Implementations§
impl Freeze for PathModel
impl RefUnwindSafe for PathModel
impl Send for PathModel
impl Sync for PathModel
impl Unpin for PathModel
impl UnsafeUnpin for PathModel
impl UnwindSafe for PathModel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.