Enum fst::raw::Error[][src]

pub enum Error {
    Version {
        expected: u64,
        got: u64,
    },
    Format {
        size: usize,
    },
    ChecksumMismatch {
        expected: u32,
        got: u32,
    },
    ChecksumMissing,
    DuplicateKey {
        got: Vec<u8>,
    },
    OutOfOrder {
        previous: Vec<u8>,
        got: Vec<u8>,
    },
    WrongType {
        expected: FstType,
        got: FstType,
    },
    FromUtf8(FromUtf8Error),
    // some variants omitted
}
Expand description

An error that occurred while using a finite state transducer.

This enum is non-exhaustive. New variants may be added to it in compatible releases.

Variants

Version

A version mismatch occurred while reading a finite state transducer.

This occurs when the API version (of the crate) does not match the version encoded in the finite state transducer.

When this error is encountered, there are only two ways to fix it:

  1. Change the version of the library to one that is compatible with the given finite state transducer.
  2. Rebuild the finite state transducer.
Show fields

Fields of Version

expected: u64

The expected version, which is hard-coded into the current version of this crate.

got: u64

The version read from the finite state transducer.

Format

An unexpected error occurred while reading a finite state transducer. Usually this occurs because the data is corrupted or is not actually a finite state transducer serialized by this library.

Show fields

Fields of Format

size: usize

The number of bytes given to the FST constructor.

ChecksumMismatch

An error that is returned if verification of an FST fails because of a checksum mismatch.

Show fields

Fields of ChecksumMismatch

expected: u32

The checksum that was expected.

got: u32

The checksum that was actually computed.

ChecksumMissing

An error that is returned if the caller attempts to verify an FST that does not have a checksum, as is the case for all FSTs generated by this crate before version 0.4.

DuplicateKey

A duplicate key was inserted into a finite state transducer, which is not allowed.

Show fields

Fields of DuplicateKey

got: Vec<u8>

The duplicate key.

OutOfOrder

A key was inserted out of order into a finite state transducer.

Keys must always be inserted in lexicographic order.

Show fields

Fields of OutOfOrder

previous: Vec<u8>

The last key successfully inserted.

got: Vec<u8>

The key that caused this error to occur.

WrongType

A finite state transducer with an unexpected type was found.

This is not currently used in this crate, but callers may wish to employ its use for alternative data structures implemented on top of finite state transducers.

Show fields

Fields of WrongType

expected: FstType

The expected finite state transducer type.

got: FstType

The type read from a finite state transducer.

FromUtf8(FromUtf8Error)

An error that occurred when trying to decode a UTF-8 byte key.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.