Skip to main content

JournalError

Enum JournalError 

pub enum JournalError {
Show 15 variants Io(Error), Serialize(String), Deserialize(String), SeqGap { expected: u64, got: u64, }, DuplicateEventId(Uuid), TruncatedRecord, UnsupportedSchemaVersion(u16), PayloadTooLarge { size: usize, }, NoValidFrames { file_len: u64, }, RunIdMismatch { expected: Uuid, got: Uuid, }, InconsistentRunId { seq: u64, expected: Uuid, got: Uuid, }, BackgroundWriterSend(String), BackgroundWriterJoin(String), RecordHashMismatch { seq: u64, expected: String, computed: String, }, HashChainBreak { seq: u64, prev_hash: Option<String>, expected: Option<String>, },
}
Expand description

Errors that can occur during journal I/O (write, read, encode/decode).

Variants§

§

Io(Error)

Underlying I/O error.

§

Serialize(String)

Serialization failure.

§

Deserialize(String)

Deserialization failure.

§

SeqGap

Non-contiguous sequence number detected during read.

Fields

§expected: u64
§got: u64
§

DuplicateEventId(Uuid)

Duplicate event_id detected during read.

§

TruncatedRecord

Frame is shorter than declared length (file truncated mid-record).

§

UnsupportedSchemaVersion(u16)

Journal event has a schema version this binary does not support.

§

PayloadTooLarge

Encoded payload exceeds the 4-byte length prefix maximum (u32::MAX).

Fields

§size: usize
§

NoValidFrames

Non-empty journal file has no decodable frames (e.g. encoding mismatch).

Fields

§file_len: u64
§

RunIdMismatch

Existing journal run_id does not match the writer run_id.

Fields

§expected: Uuid
§got: Uuid
§

InconsistentRunId

Existing journal contains multiple run_ids across records.

Fields

§seq: u64
§expected: Uuid
§got: Uuid
§

BackgroundWriterSend(String)

Background writer thread has disconnected or the channel is full.

§

BackgroundWriterJoin(String)

Background writer thread returned an I/O error.

§

RecordHashMismatch

Record hash does not match recomputed hash.

Fields

§seq: u64
§expected: String
§computed: String
§

HashChainBreak

Hash chain linkage is broken (prev_record_hash does not match previous record).

Fields

§seq: u64
§prev_hash: Option<String>
§expected: Option<String>

Trait Implementations§

§

impl Debug for JournalError

§

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

Formats the value using the given formatter. Read more
§

impl Display for JournalError

§

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

Formats the value using the given formatter. Read more
§

impl Error for JournalError

§

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

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

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0§

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

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
§

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
§

impl From<Error> for JournalError

§

fn from(source: Error) -> Self

Converts to this type from the input type.
§

impl From<JournalError> for ReplayError

§

fn from(source: JournalError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> ToString for T
where T: Display + ?Sized,

§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,