Skip to main content

ErrorDraft

Struct ErrorDraft 

Source
pub struct ErrorDraft { /* private fields */ }
Expand description

An error that still owes the reader its recovery sentence.

Both constructors return this rather than an AxError, and ErrorDraft::with_recovery is the only way across, so a failure that never says what to do next cannot be spelled. Shaping happens here; an AxError is finished the moment it exists.

Implementations§

Source§

impl ErrorDraft

Source

pub fn with_nearby(self, nearby: Vec<String>) -> Self

Names the spellings the caller could have used instead. Directly usable values only, not a description of them.

Source

pub fn retriable(self) -> Self

Declares the action safe to retry as-is. Explicit opt-in only. Puts the account back to Keep: a request worth sending again on this account is no reason to leave it.

Source

pub fn effect_unknown(self) -> Self

Declares that the request went out and its answer was lost, so whether its effect landed is not known. Drops any wait set before it, because a wait belongs to Retry::Yes alone, and keeps the account, because a lost answer is no evidence against it.

Source

pub fn account_unusable(self) -> Self

Declares that the account the request went out on cannot take it, so the next account should (D53). Sets Retry::No and drops any wait in the same step: the same request on the same account would fail the same way, however long it waited.

Source

pub fn retriable_after(self, wait_ms: u64) -> Self

Declares the action safe to retry, and no sooner than wait_ms from now: the other side’s own word on when it recovers.

Source

pub fn with_recovery(self, recovery: impl Into<String>) -> AxError

Writes the one sentence that tells the reader what to do next, and hands back the finished error. The reader is as often a model as a person, so the sentence names a key, a file and line, or a command.

Trait Implementations§

Source§

impl Clone for ErrorDraft

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ErrorDraft

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ErrorDraft

Source§

impl PartialEq for ErrorDraft

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ErrorDraft

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.