#[non_exhaustive]pub enum SubscriptionBillingServiceError {
Show 31 variants
Sql(Error),
StorageTemporarilyUnavailable(Error),
Attempt(PaymentAttemptStoreError),
Application(SubscriptionEnrollmentApplicationError),
HostChargeApplication(HostChargeApplicationError),
HostChargeStore(HostChargeStoreError),
Cancellation(SubscriptionCancellationError),
Discount(SubscriptionDiscountOperationError),
BillingTransaction(BillingTransactionError),
BillingEvent(BillingEventWriteError),
HostChargeUnavailable,
IdempotencyConflict,
AdmissionDenied {
retry_after: Duration,
},
AdmissionTimeout,
AdmissionUnavailable,
GatewayConfigurationChanged,
GatewayResolution(GatewayResolutionError),
ResolvedGatewayIdentityMismatch,
GatewayMutationCooldown {
scope: GatewayMutationCooldownScope,
},
ReservationRejected(SubscriptionEnrollmentReservationRejection),
SubmissionRejected(SubscriptionEnrollmentSubmissionRejection),
HostChargeReservationRejected(HostChargeTargetRejection),
HostChargeSubmissionRejected(HostChargeTargetRejection),
RecoveryReservationRejected(SubscriptionRecoveryReservationRejection),
RecoverySubmissionRejected(SubscriptionRecoverySubmissionRejection),
RenewalReservationRejected(SubscriptionRenewalReservationRejection),
PaymentMethodReplacementReservationRejected(SubscriptionPaymentMethodReplacementRejection),
PaymentMethodReplacementSubmissionRejected(SubscriptionPaymentMethodReplacementSubmissionRejection),
GatewayNotSubmitted(GatewayNotSubmittedError),
GatewayReadiness(GatewayError),
InvalidState(&'static str),
}Expand description
Failure returned by the high-level subscription billing facade.
This covers subscriber-owned enrollment, recovery, renewal, payment-method replacement, cancellation, discount mutations, reconciliation, and the optional host-charge capability.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Sql(Error)
Generic SQL failure whose retry safety is not proven by the owning path.
A provider-free local transaction could not acquire capacity or failed with an explicitly recognized transient SQLSTATE. Replaying the same idempotent operation after the failed transaction is discarded is safe.
Attempt(PaymentAttemptStoreError)
Canonical payment-attempt persistence failed.
Application(SubscriptionEnrollmentApplicationError)
A subscription payment outcome could not be applied atomically.
HostChargeApplication(HostChargeApplicationError)
A host-charge outcome could not be applied atomically.
HostChargeStore(HostChargeStoreError)
Canonical host-charge reservation or ledger storage failed.
Cancellation(SubscriptionCancellationError)
Subscriber cancellation failed.
Discount(SubscriptionDiscountOperationError)
Subscriber discount mutation failed.
BillingTransaction(BillingTransactionError)
The host-prepared billing transaction failed.
BillingEvent(BillingEventWriteError)
The typed event could not be appended to the host outbox.
The optional host-charge target capability was not supplied.
IdempotencyConflict
The idempotency key already owns a different immutable request.
AdmissionDenied
Host admission denied the command with an exact retry delay.
AdmissionTimeout
Host admission did not complete before its bound.
Host admission could not evaluate the command.
GatewayConfigurationChanged
Durable gateway authority changed after the command was prepared.
GatewayResolution(GatewayResolutionError)
The host could not resolve canonical gateway authority.
ResolvedGatewayIdentityMismatch
The resolver returned a gateway for a different canonical identity.
GatewayMutationCooldown
A durable account or provider cooldown stopped submission.
Fields
scope: GatewayMutationCooldownScopeCanonical cooldown level that stopped the command.
ReservationRejected(SubscriptionEnrollmentReservationRejection)
Initial-enrollment reservation returned a semantic blocker.
SubmissionRejected(SubscriptionEnrollmentSubmissionRejection)
Initial-enrollment final admission returned a semantic blocker.
HostChargeReservationRejected(HostChargeTargetRejection)
Host-charge reservation returned a semantic blocker.
HostChargeSubmissionRejected(HostChargeTargetRejection)
Host-charge final admission returned a semantic blocker.
RecoveryReservationRejected(SubscriptionRecoveryReservationRejection)
Subscriber recovery reservation returned a semantic blocker.
RecoverySubmissionRejected(SubscriptionRecoverySubmissionRejection)
Subscriber recovery final admission returned a semantic blocker.
RenewalReservationRejected(SubscriptionRenewalReservationRejection)
Automatic-renewal reservation returned a semantic blocker.
PaymentMethodReplacementReservationRejected(SubscriptionPaymentMethodReplacementRejection)
Payment-method replacement reservation returned a semantic blocker.
PaymentMethodReplacementSubmissionRejected(SubscriptionPaymentMethodReplacementSubmissionRejection)
Payment-method replacement final admission returned a semantic blocker.
GatewayNotSubmitted(GatewayNotSubmittedError)
Gateway adaptation proved that the mutation was not submitted.
GatewayReadiness(GatewayError)
The gateway readiness query failed before mutation submission.
This error does not by itself prove that no durable attempt exists. If readiness fails after reservation, transient unavailability leaves the prepared attempt retryable, while a determinate readiness failure may terminalize it with an exact resolution code before returning this error. Replaying the same command and idempotency key recovers that canonical result before admission, resolution, or provider I/O.
InvalidState(&'static str)
Durable canonical state violated an invariant required by the facade.
Implementations§
Source§impl SubscriptionBillingServiceError
impl SubscriptionBillingServiceError
Sourcepub const fn disposition(&self) -> SubscriptionBillingServiceErrorDisposition
pub const fn disposition(&self) -> SubscriptionBillingServiceErrorDisposition
Returns the stable, conservative operational category for this error.
The category intentionally does not expose provider diagnostics, payment values, or durable identifiers.
Sourcepub const fn is_retryable(&self) -> bool
pub const fn is_retryable(&self) -> bool
Returns whether it is safe to resubmit the same idempotent command.
A true result means only that Syrup Rail can safely accept another
submission of that unchanged command and idempotency key. It does not
promise that the next call will perform another payment; it may return a
canonical terminal result. Do not create a new command or idempotency
key merely because this returns true. Inspect the canonical result
before deciding whether a later payment needs a newly issued key.
Sourcepub const fn is_conflict(&self) -> bool
pub const fn is_conflict(&self) -> bool
Returns whether the command conflicts with an existing idempotency or authority snapshot.
Conflicts are not retryable as-is; reload current authority or reconcile the existing idempotency key before constructing another command.
Sourcepub const fn retry_after(&self) -> Option<Duration>
pub const fn retry_after(&self) -> Option<Duration>
Returns an exact retry delay when the service was given one.
None does not imply that the error is non-retryable. For example,
gateway/account cooldowns are temporarily unavailable but do not carry
an exact delay that this API can safely fabricate.
Trait Implementations§
Source§impl Error for SubscriptionBillingServiceError
impl Error for SubscriptionBillingServiceError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<BillingEventWriteError> for SubscriptionBillingServiceError
impl From<BillingEventWriteError> for SubscriptionBillingServiceError
Source§fn from(source: BillingEventWriteError) -> Self
fn from(source: BillingEventWriteError) -> Self
Source§impl From<BillingTransactionError> for SubscriptionBillingServiceError
impl From<BillingTransactionError> for SubscriptionBillingServiceError
Source§fn from(source: BillingTransactionError) -> Self
fn from(source: BillingTransactionError) -> Self
Source§impl From<Error> for SubscriptionBillingServiceError
impl From<Error> for SubscriptionBillingServiceError
Source§impl From<GatewayResolutionError> for SubscriptionBillingServiceError
impl From<GatewayResolutionError> for SubscriptionBillingServiceError
Source§fn from(source: GatewayResolutionError) -> Self
fn from(source: GatewayResolutionError) -> Self
Source§impl From<HostChargeApplicationError> for SubscriptionBillingServiceError
impl From<HostChargeApplicationError> for SubscriptionBillingServiceError
Source§fn from(source: HostChargeApplicationError) -> Self
fn from(source: HostChargeApplicationError) -> Self
Source§impl From<HostChargeStoreError> for SubscriptionBillingServiceError
impl From<HostChargeStoreError> for SubscriptionBillingServiceError
Source§fn from(source: HostChargeStoreError) -> Self
fn from(source: HostChargeStoreError) -> Self
Source§impl From<PaymentAttemptStoreError> for SubscriptionBillingServiceError
impl From<PaymentAttemptStoreError> for SubscriptionBillingServiceError
Source§fn from(source: PaymentAttemptStoreError) -> Self
fn from(source: PaymentAttemptStoreError) -> Self
Source§impl From<SubscriptionCancellationError> for SubscriptionBillingServiceError
impl From<SubscriptionCancellationError> for SubscriptionBillingServiceError
Source§fn from(error: SubscriptionCancellationError) -> Self
fn from(error: SubscriptionCancellationError) -> Self
Source§impl From<SubscriptionDiscountOperationError> for SubscriptionBillingServiceError
impl From<SubscriptionDiscountOperationError> for SubscriptionBillingServiceError
Source§fn from(error: SubscriptionDiscountOperationError) -> Self
fn from(error: SubscriptionDiscountOperationError) -> Self
Source§impl From<SubscriptionEnrollmentApplicationError> for SubscriptionBillingServiceError
impl From<SubscriptionEnrollmentApplicationError> for SubscriptionBillingServiceError
Source§fn from(source: SubscriptionEnrollmentApplicationError) -> Self
fn from(source: SubscriptionEnrollmentApplicationError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for SubscriptionBillingServiceError
impl !UnwindSafe for SubscriptionBillingServiceError
impl Freeze for SubscriptionBillingServiceError
impl Send for SubscriptionBillingServiceError
impl Sync for SubscriptionBillingServiceError
impl Unpin for SubscriptionBillingServiceError
impl UnsafeUnpin for SubscriptionBillingServiceError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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