Enum mongodb::error::ErrorKind[][src]

#[non_exhaustive]
pub enum ErrorKind {
Show variants InvalidArgument { message: String, }, Authentication { message: String, }, BsonDeserialization(Error), BsonSerialization(Error), BulkWrite(BulkWriteFailure), Command(CommandError), DnsResolve { message: String, }, Internal { message: String, }, Io(Arc<Error>), ConnectionPoolCleared { message: String, }, InvalidResponse { message: String, }, ServerSelection { message: String, }, SessionsNotSupported, InvalidTlsConfig { message: String, }, Write(WriteFailure), Transaction { message: String, },
}
Expand description

The types of errors that can occur.

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.
InvalidArgument

An invalid argument was provided.

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.
Show fields

Fields of InvalidArgument

message: String
Authentication

An error occurred while the Client attempted to authenticate a connection.

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.
Show fields

Fields of Authentication

message: String
BsonDeserialization(Error)

Wrapper around bson::de::Error.

BsonSerialization(Error)

Wrapper around bson::ser::Error.

BulkWrite(BulkWriteFailure)

An error occurred when trying to execute a write operation consisting of multiple writes.

Command(CommandError)

The server returned an error to an attempted operation.

DnsResolve

An error occurred during DNS resolution.

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.
Show fields

Fields of DnsResolve

message: String
Internal
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.
Show fields

Fields of Internal

message: String
Io(Arc<Error>)

Wrapper around std::io::Error.

ConnectionPoolCleared

The connection pool for a server was cleared during operation execution due to a concurrent error, causing the operation to fail.

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.
Show fields

Fields of ConnectionPoolCleared

message: String
InvalidResponse

The server returned an invalid reply to a database operation.

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.
Show fields

Fields of InvalidResponse

message: String
ServerSelection

The Client was not able to select a server for the operation.

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.
Show fields

Fields of ServerSelection

message: String
SessionsNotSupported

The Client does not support sessions.

InvalidTlsConfig
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.
Show fields

Fields of InvalidTlsConfig

message: String

An error occurred when trying to execute a write operation.

Transaction

An error occurred during a transaction.

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.
Show fields

Fields of Transaction

message: String

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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.

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.