Skip to main content

StepError

Enum StepError 

#[non_exhaustive]
pub enum StepError<P, R, I, A = Infallible> { Stopped(StopCause), Parked(Failure), Incarnation(IncarnationChanged), Pull(P), Ingest(IngestError<I>), Read(R), Push(P), Adjudicate(A), }
Expand description

Why Edge::step failed: the phase, and the failure it met.

P is the peer’s error, R the local store’s group-read error, I its ingest error and A the edge’s merge rule’s error. They are separate because a store may implement WriteGroupStore and IngestStore with different error types. No bounds sit on the enum, so it is Send exactly when the four are, and a !Send adapter’s error stays legal (ADR-0009).

A defaults to Infallible, the error of Accept, so StepError<P, R, I> still names the error of an edge that judges nothing.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Stopped(StopCause)

The edge was already stopped, for the cause named; nothing was done.

§

Parked(Failure)

The edge was already parked, by the failure named; nothing was done.

§

Incarnation(IncarnationChanged)

The far side answered as a different store; the answer was not acted on, and the edge is now stopped.

§

Pull(P)

The pull failed.

§

Ingest(IngestError<I>)

The pulled batch did not land locally; nothing in it was written.

§

Read(R)

Reading the local log failed.

§

Push(P)

The far side refused or failed the push; the local log is unchanged.

§

Adjudicate(A)

The edge’s merge rule could not judge the pulled batch; nothing in it was written, and the pull token did not advance.

Implementations§

§

impl<P: Classify, R: Classify, I: Classify, A: Classify> StepError<P, R, I, A>

pub fn failure(&self) -> Failure

The phase that failed and the class its failure stated.

Examples found in repository?
examples/two-devices-one-seat/src/error.rs (line 164)
162    pub fn failure(&self) -> Option<Failure> {
163        match self {
164            Self::Sync { source, .. } => Some(source.failure()),
165            _ => None,
166        }
167    }

Trait Implementations§

§

impl<P: Classify, R: Classify, I: Classify, A: Classify> Classify for StepError<P, R, I, A>

The class of the failure inside, so a step’s error is handled like a peer’s (ADR-0026 §2.4). A changed incarnation answers Stop; an edge stopped by a retention gap answers Reseed (SY-32); any other stopped edge answers the class it stopped on; a parked edge answers the class that parked it.

§

fn class(&self) -> FailureClass

The remedy this failure calls for.
§

impl<P: Debug, R: Debug, I: Debug, A: Debug> Debug for StepError<P, R, I, A>

§

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

Formats the value using the given formatter. Read more
§

impl<P, R, I, A> Display for StepError<P, R, I, A>

§

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

Formats the value using the given formatter. Read more
§

impl<P, R, I, A> Error for StepError<P, R, I, A>
where P: Error + 'static, IngestError<I>: Error + 'static, R: Error + 'static, A: Error + 'static, Self: Debug + Display,

§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl<P, R, I, A> Freeze for StepError<P, R, I, A>
where P: Freeze, IngestError<I>: Freeze, R: Freeze, A: Freeze,

§

impl<P, R, I, A> RefUnwindSafe for StepError<P, R, I, A>

§

impl<P, R, I, A> Send for StepError<P, R, I, A>
where P: Send, IngestError<I>: Send, R: Send, A: Send,

§

impl<P, R, I, A> Sync for StepError<P, R, I, A>
where P: Sync, IngestError<I>: Sync, R: Sync, A: Sync,

§

impl<P, R, I, A> Unpin for StepError<P, R, I, A>
where P: Unpin, IngestError<I>: Unpin, R: Unpin, A: Unpin,

§

impl<P, R, I, A> UnsafeUnpin for StepError<P, R, I, A>

§

impl<P, R, I, A> UnwindSafe for StepError<P, R, I, A>

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.