#[non_exhaustive]pub enum AuthorityError {
Unknown(AuthorityId),
Exhausted {
authority: AuthorityId,
asked: Spend,
remaining: Spend,
},
DrawsSpent {
authority: AuthorityId,
allowed: u32,
},
Revoked {
authority: AuthorityId,
reason: String,
},
Expired {
authority: AuthorityId,
expired_at: Timestamp,
},
NotHolder {
authority: AuthorityId,
holder: Holder,
drawer: String,
},
Malformed(&'static str),
AlreadyIssued(AuthorityId),
Unavailable(String),
}Expand description
Why a draw was refused.
Each variant is a different instruction to the caller, which is the whole reason they are not one error with a message: exhausted and revoked look identical in prose and mean opposite things about whether to try again.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unknown(AuthorityId)
No such authority for this tenant.
Exhausted
The draw would exceed what was authorized.
Reports the whole arithmetic rather than a bare refusal: an operator reconciling this needs to know what was asked against what was left.
DrawsSpent
It permitted a number of draws and they are used up.
Revoked
Somebody withdrew it.
Not retryable, ever. Distinct from Exhausted
because that one could in principle be followed by a larger authority,
while this one is a decision that has been taken back.
Expired
It ran out of time rather than out of ceiling.
NotHolder
The run drawing is not the one the authority was issued to.
Not retryable, and distinct from Unknown because
the fix is different: the id is right and the caller is wrong.
Fields
Malformed(&'static str)
The declaration itself is not well formed.
AlreadyIssued(AuthorityId)
Re-issuing an id under a different declaration.
Refused rather than overwritten: an id that can be redefined makes every draw already recorded against it refer to terms nobody can reconstruct. Re-issuing the identical declaration succeeds, because a retried deployment is not an attack.
The store could not be reached.
Trait Implementations§
Source§impl Clone for AuthorityError
impl Clone for AuthorityError
Source§impl Debug for AuthorityError
impl Debug for AuthorityError
Source§impl Display for AuthorityError
impl Display for AuthorityError
impl Eq for AuthorityError
Source§impl Error for AuthorityError
impl Error for AuthorityError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<StoreError> for AuthorityError
impl From<StoreError> for AuthorityError
Source§fn from(e: StoreError) -> Self
fn from(e: StoreError) -> Self
Source§impl PartialEq for AuthorityError
impl PartialEq for AuthorityError
impl StructuralPartialEq for AuthorityError
Auto Trait Implementations§
impl Freeze for AuthorityError
impl RefUnwindSafe for AuthorityError
impl Send for AuthorityError
impl Sync for AuthorityError
impl Unpin for AuthorityError
impl UnsafeUnpin for AuthorityError
impl UnwindSafe for AuthorityError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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