Skip to main content

NeonPeerError

Enum NeonPeerError 

#[non_exhaustive]
pub enum NeonPeerError<E> { Read(NeonError<E>), Ingest(IngestError<NeonError<E>>), Answer(NeonError<E>),
#[non_exhaustive]
EventTooLarge { id: EventId, len: usize, limit: usize, },
#[non_exhaustive]
TooManyEvents { actual: usize, limit: usize, },
#[non_exhaustive]
BatchTooLarge { actual: usize, limit: usize, }, }
Available on crate features event-store and sync only.
Expand description

How a NeonSyncPeer fails: the store’s error, the ingest’s refusal, or a push over the limits it declared.

Its own type rather than happenstance-sync’s StorePeerError, whose limit variants are #[non_exhaustive] and so cannot be built outside that crate. The arms mirror it, and so do their classes (SY-36). E is the transport’s error.

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(NeonError<E>)

The pull’s one request, the group read and the identity read together, failed, or its answer could not be read: the page, waiting or the responder. One arm for both reads, where StorePeerError has Read and Identity, because here they are one request and fail together. Nothing was forwarded.

§

Ingest(IngestError<NeonError<E>>)

The push’s request was refused or failed. Nothing in the push was written, save the unknown outcome IngestError::Store describes for a request that got no answer.

§

Answer(NeonError<E>)

The push’s request committed and the watermark or the identity in its answer could not be read. Re-delivering the push converges: every event in it is now a skip.

§

#[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.

Trait Implementations§

§

impl<E> Classify for NeonPeerError<E>

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

§

fn class(&self) -> FailureClass

The remedy this failure calls for.
§

impl<E: Debug> Debug for NeonPeerError<E>

§

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

Formats the value using the given formatter. Read more
§

impl<E> Display for NeonPeerError<E>

§

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

Formats the value using the given formatter. Read more
§

impl<E> Error for NeonPeerError<E>
where NeonError<E>: Error + 'static, IngestError<NeonError<E>>: Error, 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§

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.