pub struct CanonicalRoot { /* private fields */ }Expand description
Canonicalize-based path containment (non-Linux fallback).
Uses fs::canonicalize + prefix check. TOCTOU-vulnerable but
acceptable for development/macOS.
Implementations§
Source§impl CanonicalRoot
impl CanonicalRoot
Trait Implementations§
Source§impl ContainedFs for CanonicalRoot
impl ContainedFs for CanonicalRoot
Source§fn walk(&self, path: &str) -> Result<FsHandle, FsError>
fn walk(&self, path: &str) -> Result<FsHandle, FsError>
Resolve a relative path and return an FsHandle for 9P walk state.
Source§fn open(&self, path: &str, mode: OpenMode) -> Result<File, FsError>
fn open(&self, path: &str, mode: OpenMode) -> Result<File, FsError>
Open an existing file relative to the root.
Source§fn create(&self, path: &str, mode: OpenMode) -> Result<File, FsError>
fn create(&self, path: &str, mode: OpenMode) -> Result<File, FsError>
Create a file relative to the root (implies open).
Auto Trait Implementations§
impl Freeze for CanonicalRoot
impl RefUnwindSafe for CanonicalRoot
impl Send for CanonicalRoot
impl Sync for CanonicalRoot
impl Unpin for CanonicalRoot
impl UnsafeUnpin for CanonicalRoot
impl UnwindSafe for CanonicalRoot
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more