pub struct SmbPath { /* private fields */ }Expand description
A validated, component-list path. No .., no Windows-forbidden chars, no
alternate streams. Always relative to the share root; the empty path is
the root.
Each component is a filename as MS-FSCC 2.1.5.2 defines it: 1 to 255
UTF-16 code units, with no control characters and none of
" * / : < > ? \ |. The whole path is at most 32,760 UTF-16 code units.
On Windows hosts the reserved device names (CON, PRN, AUX, NUL,
COM1-COM9 and LPT1-LPT9, with or without an extension) are
rejected too.
Implementations§
Source§impl SmbPath
impl SmbPath
Sourcepub fn from_utf16(units: &[u16]) -> SmbResult<Self>
pub fn from_utf16(units: &[u16]) -> SmbResult<Self>
Construct from a UTF-16 code-unit slice (already decoded from UTF-16LE wire bytes).
Sourcepub fn components(&self) -> &[String]
pub fn components(&self) -> &[String]
Path components in order. Empty for the root.
Sourcepub fn join(&self, last: &str) -> SmbResult<SmbPath>
pub fn join(&self, last: &str) -> SmbResult<SmbPath>
Validate last and append its components to this path.
Sourcepub fn display_backslash(&self) -> String
pub fn display_backslash(&self) -> String
Render as a backslash-separated string. Empty for root.
Trait Implementations§
impl Eq for SmbPath
impl StructuralPartialEq for SmbPath
Auto Trait Implementations§
impl Freeze for SmbPath
impl RefUnwindSafe for SmbPath
impl Send for SmbPath
impl Sync for SmbPath
impl Unpin for SmbPath
impl UnsafeUnpin for SmbPath
impl UnwindSafe for SmbPath
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