pub enum GateDecision {
Allow {
budget_after_cents: u64,
},
Deny {
reason: DenyReason,
},
}Expand description
闸的判定结果。
Allow 携带扣减后的累计消费(budget_after_cents),供审计直接引用;
Deny 携带原因。金额字段一律分。
Variants§
Implementations§
Source§impl GateDecision
impl GateDecision
Sourcepub fn deny_reason(&self) -> Option<DenyReason>
pub fn deny_reason(&self) -> Option<DenyReason>
拒绝原因(Allow 时为 None)。
Trait Implementations§
Source§impl Clone for GateDecision
impl Clone for GateDecision
Source§fn clone(&self) -> GateDecision
fn clone(&self) -> GateDecision
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 moreimpl Copy for GateDecision
Source§impl Debug for GateDecision
impl Debug for GateDecision
Source§impl<'de> Deserialize<'de> for GateDecision
impl<'de> Deserialize<'de> for GateDecision
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for GateDecision
Source§impl PartialEq for GateDecision
impl PartialEq for GateDecision
Source§impl Serialize for GateDecision
impl Serialize for GateDecision
impl StructuralPartialEq for GateDecision
Auto Trait Implementations§
impl Freeze for GateDecision
impl RefUnwindSafe for GateDecision
impl Send for GateDecision
impl Sync for GateDecision
impl Unpin for GateDecision
impl UnsafeUnpin for GateDecision
impl UnwindSafe for GateDecision
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