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
单号不存在(不是本闸开出的单)。
NotOpen
单不在 Open 态(已确认/已完成/已作废)——幂等钉:同一单只能确认一次。
AmountMismatch
确认额 ≠ 审批额——金额一致钉(防夹带)。
Expired
单已过 TTL——TTL 钉(过期作废,确认过期单 = 拒)。
InvalidTtl
TTL 非法(0 = 开出来就是死的单,没有存在意义)。
EmptyProof
支付凭证为空——没有凭证的确认不是可对账的确认。
NotConfirmed
单未确认,没有「完成」可言(状态机误用/回放对账不一致)。
NotYetExpired
还没到期就写作废(状态机误用/回放对账不一致)。
DuplicatePendingId
单号重复(单号必须唯一;回放对账不一致时按 WalMismatch 上抛)。
Trait Implementations§
Source§impl Clone for PendingError
impl Clone for PendingError
Source§fn clone(&self) -> PendingError
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PendingError
impl Debug for PendingError
Source§impl Display for PendingError
impl Display for PendingError
impl Eq for PendingError
Source§impl Error for PendingError
impl Error for PendingError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for PendingError
impl PartialEq for PendingError
impl StructuralPartialEq for PendingError
Auto Trait Implementations§
impl Freeze for PendingError
impl RefUnwindSafe for PendingError
impl Send for PendingError
impl Sync for PendingError
impl Unpin for PendingError
impl UnsafeUnpin for PendingError
impl UnwindSafe for PendingError
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