#[repr(u8)]pub enum BoolWithLock {
Disabled = 0,
Enabled = 1,
DisabledLocked = 2,
EnabledLocked = 3,
}Expand description
An enum representing a boolean flag which can be locked. Byte #0: 0 = Disabled, 1 = Enabled Byte #1: 0 = Unlocked, 1 = Locked
Variants§
Implementations§
source§impl BoolWithLock
impl BoolWithLock
pub fn is_enabled(&self) -> bool
pub fn is_disabled(&self) -> bool
pub fn is_locked(&self) -> bool
sourcepub fn assert_unlocked(&self) -> Result<()>
pub fn assert_unlocked(&self) -> Result<()>
Asserts that the configuration parameter is unlocked.
Trait Implementations§
source§impl BorshDeserialize for BoolWithLock
impl BorshDeserialize for BoolWithLock
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSerialize for BoolWithLock
impl BorshSerialize for BoolWithLock
source§impl Clone for BoolWithLock
impl Clone for BoolWithLock
source§fn clone(&self) -> BoolWithLock
fn clone(&self) -> BoolWithLock
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for BoolWithLock
impl Debug for BoolWithLock
source§impl Default for BoolWithLock
impl Default for BoolWithLock
source§fn default() -> BoolWithLock
fn default() -> BoolWithLock
Returns the “default value” for a type. Read more
source§impl EnumExt for BoolWithLock
impl EnumExt for BoolWithLock
source§impl From<BoolWithLock> for u8
impl From<BoolWithLock> for u8
source§fn from(value: BoolWithLock) -> Self
fn from(value: BoolWithLock) -> Self
Converts to this type from the input type.
source§impl From<u8> for BoolWithLock
impl From<u8> for BoolWithLock
source§impl PartialEq for BoolWithLock
impl PartialEq for BoolWithLock
source§fn eq(&self, other: &BoolWithLock) -> bool
fn eq(&self, other: &BoolWithLock) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Space for BoolWithLock
impl Space for BoolWithLock
const INIT_SPACE: usize = 1usize
impl Copy for BoolWithLock
impl Eq for BoolWithLock
impl StructuralPartialEq for BoolWithLock
Auto Trait Implementations§
impl Freeze for BoolWithLock
impl RefUnwindSafe for BoolWithLock
impl Send for BoolWithLock
impl Sync for BoolWithLock
impl Unpin for BoolWithLock
impl UnwindSafe for BoolWithLock
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§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
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§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