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>>(
hash_addr: HashAddr,
uref_iter: T,
) -> Self
pub fn new<T: IntoIterator<Item = URef>>( hash_addr: HashAddr, 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 extend_access_rights(
&mut self,
access_rights: BTreeMap<URefAddr, AccessRights>,
)
pub fn extend_access_rights( &mut self, access_rights: BTreeMap<URefAddr, AccessRights>, )
Extend context access rights with access rights.
Sourcepub fn context_key(&self) -> HashAddr
pub fn context_key(&self) -> HashAddr
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 access_rights(&self) -> &BTreeMap<URefAddr, AccessRights>
pub fn access_rights(&self) -> &BTreeMap<URefAddr, AccessRights>
Returns a reference to the map of access rights.
Sourcepub fn take_access_rights(self) -> BTreeMap<URefAddr, AccessRights>
pub fn take_access_rights(self) -> BTreeMap<URefAddr, AccessRights>
Consume into 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
impl Eq for ContextAccessRights
impl StructuralPartialEq for ContextAccessRights
Auto Trait Implementations§
impl Freeze for ContextAccessRights
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more