openzeppelin_stylus::access::control

Struct RoleData

source
pub struct RoleData {
    pub has_role: StorageMap<Address, StorageBool>,
    pub admin_role: StorageFixedBytes<32>,
}
Expand description

Information about a specific role.

Fields§

§has_role: StorageMap<Address, StorageBool>

Whether an account is member of a certain role.

§admin_role: StorageFixedBytes<32>

The admin role for this role.

Trait Implementations§

source§

impl StorageType for RoleData

source§

const SLOT_BYTES: usize = 32usize

The number of bytes in a slot needed to represent the type. Must not exceed 32. For types larger than 32 bytes that are stored inline with a struct’s fields, set this to 32 and return the full size in StorageType::new. Read more
source§

const REQUIRED_SLOTS: usize = 2usize

The number of words this type must fill. For primitives this is always 0. For complex types requiring more than one inline word, set this to the total size.
source§

type Wraps<'a> = StorageGuard<'a, RoleData> where Self: 'a

For primitive types, this is the type being stored. For collections, this is the StorageType being collected.
source§

type WrapsMut<'a> = StorageGuardMut<'a, RoleData> where Self: 'a

Mutable accessor to the type being stored.
source§

unsafe fn new(root: U256, offset: u8) -> Self

Where in persistent storage the type should live. Although useful for framework designers creating new storage types, most user programs shouldn’t call this. Note: implementations will have to be const once generic_const_exprs stabilizes. Read more
source§

fn load<'s>(self) -> Self::Wraps<'s>

Load the wrapped type, consuming the accessor. Note: most types have a get and/or getter, which don’t consume Self.
source§

fn load_mut<'s>(self) -> Self::WrapsMut<'s>

Load the wrapped mutable type, consuming the accessor. Note: most types have a set and/or setter, which don’t consume Self.

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, 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.