Skip to main content

EventError

Enum EventError 

Source
pub enum EventError {
    ParseFailed {
        line_num: usize,
        reason: String,
    },
    UnknownType {
        event_type: String,
    },
    InvalidTimestamp {
        raw: String,
    },
    ShardNotFound {
        path: PathBuf,
    },
    ManifestMismatch {
        shard: PathBuf,
        expected_hash: String,
        actual_hash: String,
    },
    OversizedPayload {
        size: usize,
        max: usize,
    },
    HashCollision,
    WriteFailed {
        reason: String,
    },
    SerializeFailed {
        reason: String,
    },
}
Expand description

Errors related to event parsing, writing, and validation.

Variants§

§

ParseFailed

A line in the event file could not be parsed.

Fields

§line_num: usize

1-based line number within the shard file.

§reason: String

Description of the parse failure.

§

UnknownType

The event type string is not recognized.

Fields

§event_type: String

The unrecognized event type string.

§

InvalidTimestamp

A timestamp in an event line is malformed.

Fields

§raw: String

The raw timestamp string that failed to parse.

§

ShardNotFound

The referenced shard file does not exist on disk.

Fields

§path: PathBuf

Path where the shard was expected.

§

ManifestMismatch

A sealed shard’s content does not match its manifest.

Fields

§shard: PathBuf

Path to the shard file.

§expected_hash: String

Hash recorded in the manifest.

§actual_hash: String

Hash computed from the current file.

§

OversizedPayload

An event payload exceeds the maximum allowed size.

Fields

§size: usize

Actual payload size in bytes.

§max: usize

Maximum allowed size in bytes.

§

HashCollision

An event line contains an invalid hash.

§

WriteFailed

Failed to write an event to the shard file.

Fields

§reason: String

Description of the write failure.

§

SerializeFailed

JSON serialization of event data failed.

Fields

§reason: String

Description of the serialization failure.

Implementations§

Source§

impl EventError

Source

pub const fn error_code(&self) -> &'static str

Machine-readable error code.

Source

pub fn suggestion(&self) -> String

Human-readable suggestion.

Trait Implementations§

Source§

impl Debug for EventError

Source§

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

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

impl Display for EventError

Source§

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

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

impl Error for EventError

1.30.0 · Source§

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
Source§

impl From<EventError> for BonesError

Source§

fn from(source: EventError) -> Self

Converts to this type from the input type.

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more