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

#[non_exhaustive]
pub enum ErrorKind {
Show 25 variants AddrParse(AddrParseError), ArgumentError { message: String, }, AuthenticationError { message: String, }, BsonDecode(Error), BsonEncode(Error), BulkWriteError(BulkWriteFailure), CommandError(CommandError), DnsResolve(ResolveError), InternalError { message: String, }, InvalidDnsName(InvalidDNSNameError), InvalidHostname { hostname: String, }, Io(Error), NoDnsResults(StreamAddress), OperationError { message: String, }, OutOfRangeError(OutOfRangeError), ParseError { data_type: String, file_path: String, }, ConnectionPoolClearedError { message: String, }, ResponseError { message: String, }, ServerSelectionError { message: String, }, SrvLookupError { message: String, }, TokioTimeoutElapsed(Elapsed), RustlsConfig(TLSError), TxtLookupError { message: String, }, WaitQueueTimeoutError { address: StreamAddress, }, WriteError(WriteFailure),
}
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.
AddrParse

Wrapper around std::net::AddrParseError.

Tuple Fields of AddrParse

0: AddrParseError
ArgumentError

An invalid argument was provided 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 ArgumentError

message: String
AuthenticationError

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 AuthenticationError

message: String
BsonDecode

Wrapper around bson::de::Error.

Tuple Fields of BsonDecode

0: Error
BsonEncode

Wrapper around bson::ser::Error.

Tuple Fields of BsonEncode

0: Error
BulkWriteError

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

Tuple Fields of BulkWriteError

0: BulkWriteFailure
CommandError

The server returned an error to an attempted operation.

Tuple Fields of CommandError

0: CommandError
DnsResolve

Wrapper around trust_dns_resolver::error::ResolveError.

Tuple Fields of DnsResolve

0: ResolveError
InternalError
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 InternalError

message: String
InvalidDnsName

Wrapper around webpki::InvalidDNSNameError.

Tuple Fields of InvalidDnsName

0: InvalidDNSNameError
InvalidHostname

A hostname could not be parsed.

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 InvalidHostname

hostname: String
Io

Wrapper around std::io::Error.

Tuple Fields of Io

0: Error
NoDnsResults

Tuple Fields of NoDnsResults

0: StreamAddress
OperationError

A database operation failed to send or receive a reply.

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 OperationError

message: String
OutOfRangeError

Tuple Fields of OutOfRangeError

0: OutOfRangeError
ParseError

Data from a file could not be parsed.

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 ParseError

data_type: Stringfile_path: String
ConnectionPoolClearedError

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 ConnectionPoolClearedError

message: String
ResponseError

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 ResponseError

message: String
ServerSelectionError

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 ServerSelectionError

message: String
SrvLookupError

An error occurred during SRV record lookup.

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 SrvLookupError

message: String
TokioTimeoutElapsed

A timeout occurred before a Tokio task could be completed.

Tuple Fields of TokioTimeoutElapsed

0: Elapsed
RustlsConfig

Tuple Fields of RustlsConfig

0: TLSError
TxtLookupError

An error occurred during TXT record lookup

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 TxtLookupError

message: String
WaitQueueTimeoutError

The Client timed out while checking out a connection from connection pool.

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 WaitQueueTimeoutError

address: StreamAddress
WriteError

An error occurred when trying to execute a write operation

Tuple Fields of WriteError

0: WriteFailure

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. 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

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

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

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

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

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.