pub struct PathGuard { /* private fields */ }Expand description
The access boundary over the currently active sources.
Implementations§
Source§impl PathGuard
impl PathGuard
Sourcepub fn new(sources: Vec<GuardedSource>) -> Self
pub fn new(sources: Vec<GuardedSource>) -> Self
Build a guard over active sources only (paused/missing/removed sources grant no access).
Sourcepub fn canonicalize(path: &Path) -> OrbokResult<PathBuf>
pub fn canonicalize(path: &Path) -> OrbokResult<PathBuf>
Canonicalize a path the platform-aware way (RFC-003 §11):
resolves symlinks, .., and case differences where the platform
does.
Sourcepub fn validate(&self, requested: &Path) -> OrbokResult<ValidatedPath>
pub fn validate(&self, requested: &Path) -> OrbokResult<ValidatedPath>
RFC-003 §8 validation sequence. requested may be any path; the
canonical form decides membership, so symlinks escaping a source
are rejected regardless of how the request was spelled.
Auto Trait Implementations§
impl Freeze for PathGuard
impl RefUnwindSafe for PathGuard
impl Send for PathGuard
impl Sync for PathGuard
impl Unpin for PathGuard
impl UnsafeUnpin for PathGuard
impl UnwindSafe for PathGuard
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