[][src]Struct esl01_indexedlog::Error

pub struct Error { /* fields omitted */ }

Represents all possible errors that can occur when using indexedlog.

Methods

impl Error[src]

pub fn is_corruption(&self) -> bool[src]

Return true if the error is considered as (filesystem) data corruption.

Application can use this information to decide whether to try the expensive repair API.

Data corruption is in general when the data can be confidently read, but does not meet integrity expectation. Note: a "file not found" error is a piece of information that is "confidently read", because it's unexpected to get a different error by using different users, or process settings. So "file not found" is not always a corruption.

For example, those are data corruption errors:

  • XxHash checksum does not match the data
  • Some data says "read this file in 100..200 byte range", but logically, the file only has 150 bytes.
  • A byte is expected to only be 1 or 2. But it turns out to be 0.
  • Both file "a" and "b" are expected to exist in a directory, but "a" can be found, while "b" does not exist.

Those are not data corruption:

  • Cannot open a file due to permission issues or exceeding the file descriptor limit.
  • Programming errors and API misuse. For example, a user-provided index function says data[5..10] is the index key while data
  • Both file "a" and "b" are expected to exist in a directory, but "a" can be found, while "b" cannot be opened due to permission issues.

It's expected that data corruption can only happen when the managed files or directories are changed without using this crate. For example, a hard reboot, deleting lock files while multiple processes are attempting to write, deleting or changing files in some ways. Issues like "disk is full", "permission errors", "process killed at random time" are expected to not cause data corruption (but only data loss).

Trait Implementations

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error[src]

impl<'_> From<&'_ str> for Error[src]

Create an Error from a message.

impl<'_, E: Error + Send + Sync + 'static> From<(&'_ str, E)> for Error[src]

Create an Error from a message and another error.

Auto Trait Implementations

impl !RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl !UnwindSafe for Error

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,