#[repr(C)]pub struct RoleStore { /* private fields */ }
Expand description
Roles Store.
Implementations§
Source§impl RoleStore
impl RoleStore
Sourcepub fn enable_role(&mut self, role: &str) -> Result<(), Error>
pub fn enable_role(&mut self, role: &str) -> Result<(), Error>
Enable a role.
Sourcepub fn disable_role(&mut self, role: &str) -> Result<(), Error>
pub fn disable_role(&mut self, role: &str) -> Result<(), Error>
Disable a role.
Sourcepub fn enabled_role_index(&self, role: &str) -> Result<Option<u8>, Error>
pub fn enabled_role_index(&self, role: &str) -> Result<Option<u8>, Error>
Get the index of a enabled role.
Sourcepub fn has_role(&self, authority: &Pubkey, role: &str) -> Result<bool, Error>
pub fn has_role(&self, authority: &Pubkey, role: &str) -> Result<bool, Error>
Check if the given role is granted to the pubkey.
Sourcepub fn grant(&mut self, authority: &Pubkey, role: &str) -> Result<(), Error>
pub fn grant(&mut self, authority: &Pubkey, role: &str) -> Result<(), Error>
Grant a role to the pubkey.
§Errors
- The
role
must be enabled. - The
authority
must not already have the role.
Sourcepub fn num_members(&self) -> usize
pub fn num_members(&self) -> usize
Get the number of members.
Sourcepub fn role_value(&self, user: &Pubkey) -> Option<u32>
pub fn role_value(&self, user: &Pubkey) -> Option<u32>
Get role value for the user.
Trait Implementations§
impl Copy for RoleStore
impl Pod for RoleStore
Auto Trait Implementations§
impl Freeze for RoleStore
impl RefUnwindSafe for RoleStore
impl Send for RoleStore
impl Sync for RoleStore
impl Unpin for RoleStore
impl UnwindSafe for RoleStore
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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