pub struct Policy {
pub name: &'static str,
pub verify: fn(seg: &Segment, path: Option<&Path>) -> Option<Verdict>,
}Expand description
A single policy. Atomic: each value covers exactly one capability.
Adding a new capability is one new value with its own verify fn —
no central registry to update.
Fields§
§name: &'static strStable string id (e.g. "git:read"). Used in error messages and
for diagnostics; the CLI maps --git read to this name internally.
verify: fn(seg: &Segment, path: Option<&Path>) -> Option<Verdict>Inspect a single segment. Return [Some(Verdict::Approve)] to
vouch for the segment, [Some(Verdict::Deny)] to actively reject,
or None to abstain (let later policies have a say).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnsafeUnpin for Policy
impl UnwindSafe for Policy
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