#[non_exhaustive]#[repr(u8)]pub enum ActionState {
Pending = 0,
Completed = 1,
Cancelled = 2,
}
Expand description
Action State.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl ActionState
impl ActionState
Sourcepub fn completed(self) -> Result<ActionState, ActionError>
pub fn completed(self) -> Result<ActionState, ActionError>
Transition to Completed State.
Sourcepub fn cancelled(self) -> Result<ActionState, ActionError>
pub fn cancelled(self) -> Result<ActionState, ActionError>
Transition to Cancelled State.
Sourcepub fn is_completed_or_cancelled(&self) -> bool
pub fn is_completed_or_cancelled(&self) -> bool
Check if the state is completed or cancelled.
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Check if the state is pending.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Check if the state is cancelled.
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Check if the state is completed.
Trait Implementations§
Source§impl BorshDeserialize for ActionState
impl BorshDeserialize for ActionState
fn deserialize_reader<R>(reader: &mut R) -> Result<ActionState, Error>where
R: Read,
§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.
§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 ActionState
impl BorshSerialize for ActionState
Source§impl Clone for ActionState
impl Clone for ActionState
Source§fn clone(&self) -> ActionState
fn clone(&self) -> ActionState
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 ActionState
impl Debug for ActionState
Source§impl<'de> Deserialize<'de> for ActionState
impl<'de> Deserialize<'de> for ActionState
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActionState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActionState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ActionState
impl Display for ActionState
Source§impl EnumExt for ActionState
impl EnumExt for ActionState
Source§fn deserialize_variant<R>(
reader: &mut R,
variant_idx: u8,
) -> Result<ActionState, Error>where
R: Read,
fn deserialize_variant<R>(
reader: &mut R,
variant_idx: u8,
) -> Result<ActionState, Error>where
R: Read,
Deserialises given variant of an enum from the reader. Read more
Source§impl FromStr for ActionState
impl FromStr for ActionState
Source§impl PartialEq for ActionState
impl PartialEq for ActionState
Source§impl Serialize for ActionState
impl Serialize for ActionState
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Space for ActionState
impl Space for ActionState
const INIT_SPACE: usize = 1usize
Source§impl TryFrom<&str> for ActionState
impl TryFrom<&str> for ActionState
Source§impl TryFrom<u8> for ActionState
impl TryFrom<u8> for ActionState
Source§type Error = TryFromPrimitiveError<ActionState>
type Error = TryFromPrimitiveError<ActionState>
The type returned in the event of a conversion error.
Source§fn try_from(
number: u8,
) -> Result<ActionState, TryFromPrimitiveError<ActionState>>
fn try_from( number: u8, ) -> Result<ActionState, TryFromPrimitiveError<ActionState>>
Performs the conversion.
Source§impl TryFromPrimitive for ActionState
impl TryFromPrimitive for ActionState
const NAME: &'static str = "ActionState"
type Primitive = u8
type Error = TryFromPrimitiveError<ActionState>
fn try_from_primitive( number: <ActionState as TryFromPrimitive>::Primitive, ) -> Result<ActionState, TryFromPrimitiveError<ActionState>>
impl Copy for ActionState
impl Eq for ActionState
impl StructuralPartialEq for ActionState
Auto Trait Implementations§
impl Freeze for ActionState
impl RefUnwindSafe for ActionState
impl Send for ActionState
impl Sync for ActionState
impl Unpin for ActionState
impl UnwindSafe for ActionState
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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> 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