[][src]Enum bson::de::Error

#[non_exhaustive]pub enum Error {
    IoError(Error),
    FromUtf8Error(FromUtf8Error),
    UnrecognizedDocumentElementType {
        key: String,
        element_type: u8,
    },
    SyntaxError {
        message: String,
    },
    EndOfStream,
    InvalidTimestamp(i64),
    AmbiguousTimestamp(i64),
    DeserializationError {
        message: String,
    },
}

Possible errors that can arise during decoding.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
IoError(Error)

A std::io::Error encountered while deserializing.

FromUtf8Error(FromUtf8Error)

A std::string::FromUtf8Error encountered while decoding a UTF-8 String from the input data.

UnrecognizedDocumentElementType

While decoding a Document from bytes, an unexpected or unsupported element type was encountered.

Fields of UnrecognizedDocumentElementType

key: String

The key at which an unexpected/unsupported element type was encountered.

element_type: u8

The encountered element type.

SyntaxError

There was an error with the syntactical structure of the BSON.

Fields of SyntaxError

message: String
EndOfStream

The end of the BSON input was reached too soon.

InvalidTimestamp(i64)

An invalid timestamp was encountered while decoding.

AmbiguousTimestamp(i64)

An ambiguous timestamp was encountered while decoding.

DeserializationError

A general error encountered during deserialization. See: https://docs.serde.rs/serde/de/trait.Error.html

Fields of DeserializationError

message: String

A message describing the error.

Trait Implementations

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error[src]

impl Error for Error[src]

impl From<Error> for Error[src]

impl From<FromUtf8Error> for Error[src]

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>,