Struct casper_types::ContextAccessRights
source · pub struct ContextAccessRights { /* private fields */ }
Expand description
Access rights for a given runtime context.
Implementations§
source§impl ContextAccessRights
impl ContextAccessRights
sourcepub fn new<T: IntoIterator<Item = URef>>(context_key: Key, uref_iter: T) -> Self
pub fn new<T: IntoIterator<Item = URef>>(context_key: Key, uref_iter: T) -> Self
Creates a new instance of access rights from an iterator of URefs merging any duplicates, taking the union of their rights.
sourcepub fn context_key(&self) -> Key
pub fn context_key(&self) -> Key
Returns the current context key.
sourcepub fn extend(&mut self, urefs: &[URef])
pub fn extend(&mut self, urefs: &[URef])
Extends the current access rights from a given set of URefs.
sourcepub fn has_access_rights_to_uref(&self, uref: &URef) -> bool
pub fn has_access_rights_to_uref(&self, uref: &URef) -> bool
Checks whether given uref has enough access rights.
sourcepub fn grant_access(&mut self, uref: URef) -> GrantedAccess
pub fn grant_access(&mut self, uref: URef) -> GrantedAccess
Grants access to a URef
; unless access was pre-existing.
sourcepub fn remove_access(
&mut self,
uref_addr: URefAddr,
access_rights: AccessRights
)
pub fn remove_access( &mut self, uref_addr: URefAddr, access_rights: AccessRights )
Remove access for a given URef
.
Trait Implementations§
source§impl Debug for ContextAccessRights
impl Debug for ContextAccessRights
source§impl PartialEq for ContextAccessRights
impl PartialEq for ContextAccessRights
source§fn eq(&self, other: &ContextAccessRights) -> bool
fn eq(&self, other: &ContextAccessRights) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ContextAccessRights
impl StructuralEq for ContextAccessRights
impl StructuralPartialEq for ContextAccessRights
Auto Trait Implementations§
impl RefUnwindSafe for ContextAccessRights
impl Send for ContextAccessRights
impl Sync for ContextAccessRights
impl Unpin for ContextAccessRights
impl UnwindSafe for ContextAccessRights
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