#[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<Self, ActionError>
pub fn completed(self) -> Result<Self, ActionError>
Transition to Completed State.
Sourcepub fn cancelled(self) -> Result<Self, ActionError>
pub fn cancelled(self) -> Result<Self, 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: 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 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 duplicate 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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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§impl From<ActionState> for u8
impl From<ActionState> for u8
Source§fn from(enum_value: ActionState) -> Self
fn from(enum_value: ActionState) -> Self
Converts to this type from the input type.
Source§impl FromStr for ActionState
impl FromStr for ActionState
Source§impl IdlBuild for ActionState
impl IdlBuild for ActionState
Source§fn create_type() -> Option<IdlTypeDef>
fn create_type() -> Option<IdlTypeDef>
Create an IDL type definition for the type. Read more
Source§fn insert_types(types: &mut BTreeMap<String, IdlTypeDef>)
fn insert_types(types: &mut BTreeMap<String, IdlTypeDef>)
Insert all types that are included in the current type definition to the given map.
Source§fn get_full_path() -> String
fn get_full_path() -> String
Get the full module path of the type. Read more
Source§impl PartialEq for ActionState
impl PartialEq for ActionState
Source§impl Serialize for ActionState
impl Serialize for ActionState
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§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: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
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