pub struct Attenuated<P: Permission, S: Scope> { /* private fields */ }Expand description
A capability that has been narrowed to a specific scope.
Created via Cap::attenuate. The attenuated capability can only act on
targets that pass the scope’s check method.
§Example
ⓘ
let root = test_root();
let scoped = root.grant::<FsRead>().attenuate(DirScope::new("/tmp").unwrap());
assert!(scoped.check("/tmp/data.txt").is_ok());
assert!(scoped.check("/etc/passwd").is_err());Implementations§
Source§impl<P: Permission, S: Scope> Attenuated<P, S>
impl<P: Permission, S: Scope> Attenuated<P, S>
Auto Trait Implementations§
impl<P, S> Freeze for Attenuated<P, S>where
S: Freeze,
impl<P, S> RefUnwindSafe for Attenuated<P, S>where
S: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, S> !Send for Attenuated<P, S>
impl<P, S> !Sync for Attenuated<P, S>
impl<P, S> Unpin for Attenuated<P, S>
impl<P, S> UnsafeUnpin for Attenuated<P, S>where
S: UnsafeUnpin,
impl<P, S> UnwindSafe for Attenuated<P, S>where
S: UnwindSafe,
P: UnwindSafe,
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