pub struct ReadDenyMatcher { /* private fields */ }Expand description
Runtime matcher for read-deny entries in a filesystem sandbox policy.
Implementations§
Source§impl ReadDenyMatcher
impl ReadDenyMatcher
Sourcepub fn new(
file_system_sandbox_policy: &FileSystemSandboxPolicy,
cwd: &Path,
) -> Option<Self>
pub fn new( file_system_sandbox_policy: &FileSystemSandboxPolicy, cwd: &Path, ) -> Option<Self>
Builds a matcher from exact deny-read roots and deny-read glob entries.
Returns None when the policy has no deny-read restrictions, so callers
can skip read-deny checks without allocating matcher state. The cwd
resolves cwd-relative policy paths and special paths before matching.
Sourcepub fn try_new(
file_system_sandbox_policy: &FileSystemSandboxPolicy,
cwd: &Path,
) -> Result<Option<Self>, String>
pub fn try_new( file_system_sandbox_policy: &FileSystemSandboxPolicy, cwd: &Path, ) -> Result<Option<Self>, String>
Builds a matcher for callers that must reject malformed glob patterns.
Runtime read checks intentionally fail closed on malformed deny patterns. Host-side expansion work should use this constructor instead so a typo cannot broaden the set of paths it mutates before execution starts.
Sourcepub fn is_read_denied(&self, path: &Path) -> bool
pub fn is_read_denied(&self, path: &Path) -> bool
Returns whether path is denied by the policy used to build this matcher.
Auto Trait Implementations§
impl Freeze for ReadDenyMatcher
impl RefUnwindSafe for ReadDenyMatcher
impl Send for ReadDenyMatcher
impl Sync for ReadDenyMatcher
impl Unpin for ReadDenyMatcher
impl UnsafeUnpin for ReadDenyMatcher
impl UnwindSafe for ReadDenyMatcher
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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