pub enum TransactionState {
Draft,
Negotiating,
AwaitingUserAuthorization,
AwaitingPaymentMethod,
InterventionRequired(Box<InterventionState>),
Authorized,
Completed,
Canceled,
Failed,
}Available on crate feature
payments only.Expand description
Canonical transaction state machine shared by ACP and AP2 adapters.
Variants§
Draft
Negotiating
AwaitingUserAuthorization
AwaitingPaymentMethod
InterventionRequired(Box<InterventionState>)
Authorized
Completed
Canceled
Failed
Implementations§
Source§impl TransactionState
impl TransactionState
Sourcepub fn can_transition_to(&self, next: &TransactionState) -> bool
pub fn can_transition_to(&self, next: &TransactionState) -> bool
Returns true when the transition is allowed by the canonical
transaction state machine.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns true when no further canonical payment progress is expected.
Sourcepub fn tag(&self) -> TransactionStateTag
pub fn tag(&self) -> TransactionStateTag
Returns the state tag without carrying the full transition payload.
Trait Implementations§
Source§impl Clone for TransactionState
impl Clone for TransactionState
Source§fn clone(&self) -> TransactionState
fn clone(&self) -> TransactionState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TransactionState
impl Debug for TransactionState
Source§impl<'de> Deserialize<'de> for TransactionState
impl<'de> Deserialize<'de> for TransactionState
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransactionState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransactionState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TransactionState
impl PartialEq for TransactionState
Source§fn eq(&self, other: &TransactionState) -> bool
fn eq(&self, other: &TransactionState) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TransactionState
impl Serialize for TransactionState
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
impl StructuralPartialEq for TransactionState
Auto Trait Implementations§
impl Freeze for TransactionState
impl RefUnwindSafe for TransactionState
impl Send for TransactionState
impl Sync for TransactionState
impl Unpin for TransactionState
impl UnsafeUnpin for TransactionState
impl UnwindSafe for TransactionState
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