pub struct PathGuardBuilder { /* private fields */ }Expand description
Implementations§
Source§impl PathGuardBuilder
impl PathGuardBuilder
Sourcepub fn allowed_paths<I, S>(self, paths: I) -> Self
pub fn allowed_paths<I, S>(self, paths: I) -> Self
Add the raw allowed_paths entries (absolute, ~-prefixed, or
relative to the workspace root).
Sourcepub fn extra_blocked_paths<I, S>(self, paths: I) -> Self
pub fn extra_blocked_paths<I, S>(self, paths: I) -> Self
Append prefixes to the default blocked list.
Sourcepub fn blocked_paths<I, S>(self, paths: I) -> Self
pub fn blocked_paths<I, S>(self, paths: I) -> Self
Replace the blocked-prefix list entirely, dropping the defaults.
Only for callers that need a bespoke policy — the defaults exist to
stop an over-broad allowed_paths entry like "/" from reaching
system configuration.
Sourcepub fn home(self, home: Option<&Path>) -> Self
pub fn home(self, home: Option<&Path>) -> Self
The home directory used to expand ~ in configured paths.
Sourcepub fn build(self) -> Result<PathGuard, String>
pub fn build(self) -> Result<PathGuard, String>
Resolve everything and build the guard.
Returns Err for a configuration entry that cannot be resolved (bad
~ expansion) so a typo in settings.json surfaces at startup rather
than as a confusing tool error mid-session. Entries swallowed by a
blocked prefix are dropped with a warning — they’re pointless, not
dangerous.
Trait Implementations§
Auto Trait Implementations§
impl Forget for PathGuardBuilder
impl Freeze for PathGuardBuilder
impl RefUnwindSafe for PathGuardBuilder
impl Send for PathGuardBuilder
impl Sync for PathGuardBuilder
impl Unpin for PathGuardBuilder
impl UnsafeUnpin for PathGuardBuilder
impl UnwindSafe for PathGuardBuilder
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