pub struct Access { /* private fields */ }Expand description
Constructed by trusted host code. Deliberately NOT Deserialize: request bodies cannot create or enlarge grants. These checks do not sandbox a hostile local OS user.
Implementations§
Source§impl Access
impl Access
pub fn new( actor: impl Into<String>, reads: Vec<Scope>, writes: Vec<Scope>, caps: Vec<Capability>, ) -> Result<Self>
pub fn operator(scopes: Vec<Scope>) -> Result<Self>
pub fn agent(scopes: Vec<Scope>) -> Result<Self>
pub fn readonly(scopes: Vec<Scope>) -> Result<Self>
pub fn delegate( &self, actor: impl Into<String>, reads: Vec<Scope>, writes: Vec<Scope>, caps: Vec<Capability>, ) -> Result<Self>
pub fn has(&self, cap: Capability) -> bool
pub fn require(&self, cap: Capability) -> Result<()>
pub fn read(&self, scope: &Scope) -> Result<()>
pub fn write(&self, scope: &Scope, cap: Capability) -> Result<()>
pub fn scopes(&self) -> impl Iterator<Item = &Scope>
pub fn writable_scopes(&self) -> impl Iterator<Item = &Scope>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Access
impl RefUnwindSafe for Access
impl Send for Access
impl Sync for Access
impl Unpin for Access
impl UnsafeUnpin for Access
impl UnwindSafe for Access
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