pub enum FreshnessDecision {
Valid,
StaleTtl {
reason: Box<InvalidationReason>,
},
SignatureMismatch {
reason: Box<InvalidationReason>,
},
DomainMismatch {
reason: Box<InvalidationReason>,
},
}Expand description
Decision produced by check.
Variants§
Valid
Contract is still valid for the observed context.
StaleTtl
Contract expired (elapsed > max_age).
Fields
§
reason: Box<InvalidationReason>Structured invalidation reason.
SignatureMismatch
Signature hash did not match the observed value.
Fields
§
reason: Box<InvalidationReason>Structured invalidation reason.
DomainMismatch
Target domain did not match the contract’s domain.
Fields
§
reason: Box<InvalidationReason>Structured invalidation reason.
Implementations§
Source§impl FreshnessDecision
impl FreshnessDecision
Sourcepub const fn is_invalid(&self) -> bool
pub const fn is_invalid(&self) -> bool
true when the contract is invalid (any non-Valid variant).
Sourcepub fn reason(&self) -> Option<&InvalidationReason>
pub fn reason(&self) -> Option<&InvalidationReason>
Invalid InvalidationReason when the decision is non-Valid.
Trait Implementations§
Source§impl Clone for FreshnessDecision
impl Clone for FreshnessDecision
Source§fn clone(&self) -> FreshnessDecision
fn clone(&self) -> FreshnessDecision
Returns a duplicate of the value. Read more
1.0.0 · 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 FreshnessDecision
impl Debug for FreshnessDecision
Source§impl<'de> Deserialize<'de> for FreshnessDecision
impl<'de> Deserialize<'de> for FreshnessDecision
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
Source§impl Display for FreshnessDecision
impl Display for FreshnessDecision
Source§impl PartialEq for FreshnessDecision
impl PartialEq for FreshnessDecision
Source§impl Serialize for FreshnessDecision
impl Serialize for FreshnessDecision
impl Eq for FreshnessDecision
impl StructuralPartialEq for FreshnessDecision
Auto Trait Implementations§
impl Freeze for FreshnessDecision
impl RefUnwindSafe for FreshnessDecision
impl Send for FreshnessDecision
impl Sync for FreshnessDecision
impl Unpin for FreshnessDecision
impl UnsafeUnpin for FreshnessDecision
impl UnwindSafe for FreshnessDecision
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.