pub struct CancellationGuard { /* private fields */ }Expand description
Ensures on_verified_payment_canceled runs at most once for a payment.
Implementations§
Source§impl CancellationGuard
impl CancellationGuard
Sourcepub fn with_settled_phases(
self,
phases: impl IntoIterator<Item = SettlePhase>,
) -> Self
pub fn with_settled_phases( self, phases: impl IntoIterator<Item = SettlePhase>, ) -> Self
Records settle phases already completed before the handler.
Sourcepub fn with_before_handler(self, settlement: CompletedSettlement) -> Self
pub fn with_before_handler(self, settlement: CompletedSettlement) -> Self
Stores the before-handler settle receipt for failure-path echo.
Sourcepub const fn settled_phases(&self) -> &[SettlePhase]
pub const fn settled_phases(&self) -> &[SettlePhase]
Settle phases recorded on this guard.
Sourcepub const fn before_handler(&self) -> Option<&CompletedSettlement>
pub const fn before_handler(&self) -> Option<&CompletedSettlement>
Before-handler settle receipt, when one was stored.
Sourcepub async fn cancel(
&self,
reason: CancelReason,
error: Option<&str>,
response_status: Option<u16>,
) -> Option<SettleResponse>
pub async fn cancel( &self, reason: CancelReason, error: Option<&str>, response_status: Option<u16>, ) -> Option<SettleResponse>
Fires cancel hooks if not already fired.
When SettlePhase::BeforeHandler is in Self::settled_phases and
the matched scheme’s settle_on_cancel returns requirements, settles
at SettlePhase::Cancel.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CancellationGuard
impl !RefUnwindSafe for CancellationGuard
impl !UnwindSafe for CancellationGuard
impl Send for CancellationGuard
impl Sync for CancellationGuard
impl Unpin for CancellationGuard
impl UnsafeUnpin for CancellationGuard
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