pub enum GrantClass {
Prepaid,
Underwritten,
}Expand description
The grant class — couples anonymity to spend mode (#928 rule 4).
Variants§
Prepaid
Bearer-like: paid up front, so the issuer bears no credit risk and needs
no recourse relationship — issuable to a bare did:key with no identity.
Restricted to lease/prevention mode: overspend is made impossible, not
detected after the fact.
Underwritten
Postpaid: the issuer has a real bilateral relationship (employment, contract, billing) and recovers from cheaters itself. The only detect-mode-eligible class. The issuer’s knowledge of its holder is a bilateral relationship, never protocol data.
Implementations§
Source§impl GrantClass
impl GrantClass
Sourcepub fn detect_mode_eligible(self) -> bool
pub fn detect_mode_eligible(self) -> bool
Whether this class may be spent in detect mode.
Detect mode observes overspend after it happens and relies on recourse
to recover — which requires a relationship with the holder. A prepaid
bearer grant has no such relationship, so detect mode on it is worthless
(detection without recourse) and impossible to act on (recourse without
identity). The coupling is therefore a protocol rule, not a policy knob:
only GrantClass::Underwritten is detect-mode-eligible.
Trait Implementations§
Source§impl Clone for GrantClass
impl Clone for GrantClass
Source§fn clone(&self) -> GrantClass
fn clone(&self) -> GrantClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GrantClass
impl Debug for GrantClass
Source§impl PartialEq for GrantClass
impl PartialEq for GrantClass
Source§fn eq(&self, other: &GrantClass) -> bool
fn eq(&self, other: &GrantClass) -> bool
self and other values to be equal, and is used by ==.impl Copy for GrantClass
impl Eq for GrantClass
impl StructuralPartialEq for GrantClass
Auto Trait Implementations§
impl Freeze for GrantClass
impl RefUnwindSafe for GrantClass
impl Send for GrantClass
impl Sync for GrantClass
impl Unpin for GrantClass
impl UnsafeUnpin for GrantClass
impl UnwindSafe for GrantClass
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
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
key and return true if they are equal.§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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