Skip to main content

PendingError

Enum PendingError 

Source
pub enum PendingError {
    UnknownPending {
        pending_id: String,
    },
    NotOpen {
        pending_id: String,
        state: PendingState,
    },
    AmountMismatch {
        pending_id: String,
        approved_cents: u64,
        given_cents: u64,
    },
    Expired {
        pending_id: String,
        expires_ts: u64,
        now_ts: u64,
    },
    InvalidTtl {
        ttl_secs: u64,
    },
    EmptyProof,
    NotConfirmed {
        pending_id: String,
        state: PendingState,
    },
    NotYetExpired {
        pending_id: String,
        expires_ts: u64,
        now_ts: u64,
    },
    DuplicatePendingId {
        pending_id: String,
    },
}
Expand description

人在环待支付被拒(三钉 / 单号不存在 / 凭证缺失)。fail-closed:宁可拒,不可放。

Variants§

§

UnknownPending

单号不存在(不是本闸开出的单)。

Fields

§pending_id: String
§

NotOpen

单不在 Open 态(已确认/已完成/已作废)——幂等钉:同一单只能确认一次。

Fields

§pending_id: String
§

AmountMismatch

确认额 ≠ 审批额——金额一致钉(防夹带)。

Fields

§pending_id: String
§approved_cents: u64
§given_cents: u64
§

Expired

单已过 TTL——TTL 钉(过期作废,确认过期单 = 拒)。

Fields

§pending_id: String
§expires_ts: u64
§now_ts: u64
§

InvalidTtl

TTL 非法(0 = 开出来就是死的单,没有存在意义)。

Fields

§ttl_secs: u64
§

EmptyProof

支付凭证为空——没有凭证的确认不是可对账的确认。

§

NotConfirmed

单未确认,没有「完成」可言(状态机误用/回放对账不一致)。

Fields

§pending_id: String
§

NotYetExpired

还没到期就写作废(状态机误用/回放对账不一致)。

Fields

§pending_id: String
§expires_ts: u64
§now_ts: u64
§

DuplicatePendingId

单号重复(单号必须唯一;回放对账不一致时按 WalMismatch 上抛)。

Fields

§pending_id: String

Trait Implementations§

Source§

impl Clone for PendingError

Source§

fn clone(&self) -> PendingError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PendingError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PendingError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PendingError

Source§

impl Error for PendingError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for PendingError

Source§

fn eq(&self, other: &PendingError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PendingError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.