Skip to main content

StorePeerError

Enum StorePeerError 

#[non_exhaustive]
pub enum StorePeerError<R, W, A = Infallible> { Read(R), Ingest(IngestError<W>), Watermark(W), Identity(W),
#[non_exhaustive]
EventTooLarge { id: EventId, len: usize, limit: usize, },
#[non_exhaustive]
TooManyEvents { actual: usize, limit: usize, },
#[non_exhaustive]
BatchTooLarge { actual: usize, limit: usize, }, Adjudicate(A), }
Expand description

How a StoreSyncPeer fails: its store’s group-read error R, its ingest error W, its merge rule’s error A, or a push over the limits it declared.

The store’s errors are type parameters, never strings (RS-30-2), and each states its own class (SY-36). No bounds on the enum, so it is Send exactly when the store’s and the rule’s errors are (ADR-0009). A defaults to Infallible, the error of Accept, so StorePeerError<R, W> still names the error of a peer 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.
§

Read(R)

The far store’s group read failed; the store’s error states the class.

§

Ingest(IngestError<W>)

The far store refused or failed the ingest. Nothing in the push was written, save the unknown outcome IngestError::Store describes.

§

Watermark(W)

The ingest landed and the watermark to confirm it could not be read. Re-delivering the push converges: every event in it is now a skip.

§

Identity(W)

The far store’s identity, which every answer names (ADR-0104), could not be read. After a push the ingest has landed, and re-delivering it converges as for Watermark; after a pull nothing was forwarded.

§

#[non_exhaustive]
EventTooLarge

One event is larger than the declared max_event_bytes, so no split can carry it: Park.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§id: EventId

The first such event in the push.

§len: usize

Its payload bytes.

§limit: usize

What this peer declared.

§

#[non_exhaustive]
TooManyEvents

The push carries more events than the declared max_batch_events: Split.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§actual: usize

What was offered.

§limit: usize

What this peer declared.

§

#[non_exhaustive]
BatchTooLarge

The push carries more payload bytes than the declared max_batch_bytes: Split.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§actual: usize

What was offered.

§limit: usize

What this peer declared.

§

Adjudicate(A)

The peer’s merge rule could not judge the push; nothing in it was written. The rule’s error states the class.

Trait Implementations§

§

impl<R: Classify, W: Classify, A: Classify> Classify for StorePeerError<R, W, A>

The store’s arms ask the store’s error, the rule’s arm the rule’s; the limit arms are fixed by the arm (SY-36).

§

fn class(&self) -> FailureClass

The remedy this failure calls for.
§

impl<R: Debug, W: Debug, A: Debug> Debug for StorePeerError<R, W, A>

§

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

Formats the value using the given formatter. Read more
§

impl<R, W, A> Display for StorePeerError<R, W, A>
where IngestError<W>: Display,

§

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

Formats the value using the given formatter. Read more
§

impl<R, W, A> Error for StorePeerError<R, W, A>
where R: Error + 'static, IngestError<W>: Error, W: 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<R, W, A> Freeze for StorePeerError<R, W, A>
where R: Freeze, IngestError<W>: Freeze, W: Freeze, A: Freeze,

§

impl<R, W, A> RefUnwindSafe for StorePeerError<R, W, A>

§

impl<R, W, A> Send for StorePeerError<R, W, A>
where R: Send, IngestError<W>: Send, W: Send, A: Send,

§

impl<R, W, A> Sync for StorePeerError<R, W, A>
where R: Sync, IngestError<W>: Sync, W: Sync, A: Sync,

§

impl<R, W, A> Unpin for StorePeerError<R, W, A>
where R: Unpin, IngestError<W>: Unpin, W: Unpin, A: Unpin,

§

impl<R, W, A> UnsafeUnpin for StorePeerError<R, W, A>

§

impl<R, W, A> UnwindSafe for StorePeerError<R, W, 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.