Enum bonsaidb::core::Error[][src]

pub enum Error {
Show 33 variants SchemaMismatch { database_name: String, schema: SchemaName, stored_schema: SchemaName, }, SchemaAlreadyRegistered(SchemaName), SchemaNotRegistered(SchemaName), ViewAlreadyRegistered(ViewName), InvalidDatabaseName(String), DatabaseNotFound(String), ViewNotFound, CollectionNotFound, ApiNotFound(ApiName), DatabaseNameAlreadyTaken(String), Database(String), Serialization(String), Server(String), Transport(String), Websocket(String), Networking(Error), Io(String), Configuration(String), Client(String), CollectionAlreadyDefined, DocumentNotFound(CollectionNameBox<DocumentId, Global>), DocumentIdTooLong, DocumentConflict(CollectionNameBox<Header, Global>), UniqueKeyViolation { view: ViewName, conflicting_document: Box<Header, Global>, existing_document: Box<Header, Global>, }, DocumentPush(CollectionNameNextValueError), InvalidName(InvalidNameError), PermissionDenied(PermissionDenied), Password(String), UserNotFound, InvalidUnicode(String), InvalidCredentials, ReduceUnimplemented, NotANumber,
}
Expand description

an enumeration of errors that this crate can produce

Variants

SchemaMismatch

Fields

database_name: String

The name of the database being accessed.

schema: SchemaName

The schema provided for the database.

stored_schema: SchemaName

The schema stored for the database.

The database named database_name was created with a different schema (stored_schema) than provided (schema).

SchemaAlreadyRegistered(SchemaName)

Tuple Fields

The SchemaName returned has already been registered.

SchemaNotRegistered(SchemaName)

Tuple Fields

The SchemaName requested was not registered.

ViewAlreadyRegistered(ViewName)

Tuple Fields

The ViewName returned has already been registered.

InvalidDatabaseName(String)

Tuple Fields

0: String

An invalid database name was specified. See StorageConnection::create_database() for database name requirements.

DatabaseNotFound(String)

Tuple Fields

0: String

The database name given was not found.

ViewNotFound

The view was not found.

CollectionNotFound

The collection was not found.

ApiNotFound(ApiName)

Tuple Fields

The api invoked was not found.

DatabaseNameAlreadyTaken(String)

Tuple Fields

0: String

The database name already exists.

Database(String)

Tuple Fields

0: String

An error from interacting with local storage.

Serialization(String)

Tuple Fields

0: String

An error serializing data.

Server(String)

Tuple Fields

0: String

An error from interacting with a server.

Transport(String)

Tuple Fields

0: String

An error occurred from the QUIC transport layer.

Websocket(String)

Tuple Fields

0: String

An error occurred from the websocket transport layer.

Networking(Error)

Tuple Fields

0: Error

An error occurred from networking.

Io(String)

Tuple Fields

0: String

An error occurred from IO.

Configuration(String)

Tuple Fields

0: String

An error occurred with the provided configuration options.

Client(String)

Tuple Fields

0: String

An error occurred inside of the client.

CollectionAlreadyDefined

A Collection being added already exists. This can be caused by a collection name not being unique.

DocumentNotFound(CollectionNameBox<DocumentId, Global>)

Tuple Fields

An attempt to update a document that doesn’t exist.

DocumentIdTooLong

A value provided as a DocumentId exceeded DocumentId::MAX_LENGTH.

DocumentConflict(CollectionNameBox<Header, Global>)

Tuple Fields

When updating a document, if a situation is detected where the contents have changed on the server since the Revision provided, a Conflict error will be returned.

UniqueKeyViolation

Fields

view: ViewName

The name of the view that the unique key violation occurred.

conflicting_document: Box<Header, Global>

The document that caused the violation.

existing_document: Box<Header, Global>

The document that already uses the same key.

When saving a document in a collection with unique views, a document emits a key that is already emitted by an existing ocument, this error is returned.

DocumentPush(CollectionNameNextValueError)

Tuple Fields

When pushing a document, an error occurred while generating the next unique id.

InvalidName(InvalidNameError)

Tuple Fields

An invalid name was specified during schema creation.

PermissionDenied(PermissionDenied)

Tuple Fields

Permission was denied.

Password(String)

Tuple Fields

0: String

An internal error handling passwords was encountered.

UserNotFound

The user specified was not found. This will not be returned in response to an invalid username being used during login. It will be returned in other APIs that operate upon users.

InvalidUnicode(String)

Tuple Fields

0: String

An error occurred converting from bytes to Utf-8.

InvalidCredentials

The credentials specified are not valid.

ReduceUnimplemented

Returned when the a view’s reduce() function is unimplemented.

NotANumber

A floating point operation yielded Not a Number.

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

Deserialize this value from the given Serde deserializer. 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.

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.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Serialize this value into the given Serde serializer. Read more

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.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

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)

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more