#[non_exhaustive]
pub enum ErrorKind {
Show 18 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, }, MissingResumeToken,
}
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

Fields

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

An invalid argument was provided.

Authentication

Fields

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

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

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

Fields

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

An error occurred during DNS resolution.

Internal

Fields

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

Io(Arc<Error>)

Wrapper around std::io::Error.

ConnectionPoolCleared

Fields

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

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

InvalidResponse

Fields

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

The server returned an invalid reply to a database operation.

ServerSelection

Fields

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

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

SessionsNotSupported

The Client does not support sessions.

InvalidTlsConfig

Fields

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

Write(WriteFailure)

An error occurred when trying to execute a write operation.

Transaction

Fields

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

An error occurred during a transaction.

IncompatibleServer

Fields

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

The server does not support the operation.

MissingResumeToken

No resume token was present in a change stream document.

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

👎 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

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

Provides type based access to context intended for error reports. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

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

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.