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

pub enum Error {
    Version {
        expected: u64,
        got: u64,
    },
    Format,
    DuplicateKey {
        got: Vec<u8>,
    },
    OutOfOrder {
        previous: Vec<u8>,
        got: Vec<u8>,
    },
    WrongType {
        expected: FstType,
        got: FstType,
    },
    FromUtf8(FromUtf8Error),
}

An error that occurred while using a finite state transducer.

Variants

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.

Fields of Version

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

The version read from the finite state transducer.

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.

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

Fields of DuplicateKey

The duplicate key.

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

Keys must always be inserted in lexicographic order.

Fields of OutOfOrder

The last key successfully inserted.

The key that caused this error to occur.

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.

Fields of WrongType

The expected finite state transducer type.

The type read from a finite state transducer.

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

Trait Implementations

impl Display for Error
[src]

Formats the value using the given formatter. Read more

impl Debug for Error
[src]

Formats the value using the given formatter.

impl Error for Error
[src]

A short description of the error. Read more

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

impl From<FromUtf8Error> for Error
[src]

Performs the conversion.