Enum bson::ser::Error [−][src]
#[non_exhaustive]
pub enum Error {
Io(Arc<Error>),
InvalidDocumentKey(Bson),
InvalidCString(String),
SerializationError {
message: String,
},
UnsignedIntegerExceededRange(u64),
}Expand description
Possible errors that can arise during encoding.
Variants (Non-exhaustive)
This enum is marked as 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.
A std::io::Error encountered while serializing.
InvalidDocumentKey(Bson)A key could not be serialized to a BSON string.
Tuple Fields of InvalidDocumentKey
0: BsonInvalidCString(String)An invalid string was specified.
Tuple Fields of InvalidCString
0: StringA general error that occurred during serialization. See: https://docs.rs/serde/1.0.110/serde/ser/trait.Error.html#tymethod.custom
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
Fields of SerializationError
message: StringA message describing the error.
UnsignedIntegerExceededRange(u64)An unsigned integer type could not fit into a signed integer type.
Tuple Fields of UnsignedIntegerExceededRange
0: u64Trait Implementations
👎 Deprecated since 1.33.0:
replaced by Error::source, which can support downcasting
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()
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
Blanket Implementations
Mutably borrows from an owned value. Read more