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

#[non_exhaustive]
pub enum ErrorKind {
Show 17 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, }, IncompatibleServer { 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.

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.

Fields of Authentication

message: String
BsonDeserialization(Error)

Wrapper around bson::de::Error.

Tuple Fields of BsonDeserialization

0: Error
BsonSerialization(Error)

Wrapper around bson::ser::Error.

Tuple Fields of BsonSerialization

0: Error
BulkWrite(BulkWriteFailure)

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

Tuple Fields of BulkWrite

0: BulkWriteFailure
Command(CommandError)

The server returned an error to an attempted operation.

Tuple Fields of Command

0: CommandError
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.

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.

Fields of Internal

message: String
Io(Arc<Error>)

Wrapper around std::io::Error.

Tuple Fields of Io

0: Arc<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.

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.

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.

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.

Fields of InvalidTlsConfig

message: String

An error occurred when trying to execute a write operation.

Tuple Fields of Write

0: WriteFailure
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.

Fields of Transaction

message: String
IncompatibleServer

The server does not support 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.

Fields of IncompatibleServer

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.

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.