Struct ContextAccessRights

Source
pub struct ContextAccessRights { /* private fields */ }
Expand description

Access rights for a given runtime context.

Implementations§

Source§

impl ContextAccessRights

Source

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.

Source

pub fn context_key(&self) -> Key

Returns the current context key.

Source

pub fn extend(&mut self, urefs: &[URef])

Extends the current access rights from a given set of URefs.

Source

pub fn has_access_rights_to_uref(&self, uref: &URef) -> bool

Checks whether given uref has enough access rights.

Source

pub fn grant_access(&mut self, uref: URef) -> GrantedAccess

Grants access to a URef; unless access was pre-existing.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ContextAccessRights

Source§

fn eq(&self, other: &ContextAccessRights) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ContextAccessRights

Source§

impl StructuralPartialEq for ContextAccessRights

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.