#[non_exhaustive]pub enum Error {
Show 14 variants
Io(Error),
Corruption {
message: String,
},
InvalidFormat {
message: String,
},
UnsupportedFormat {
message: String,
},
CodecUnavailable {
codec: String,
},
Conflict {
message: String,
},
ReadOnly,
Closed,
RuntimeBusy {
message: String,
},
BucketMissing {
name: String,
},
InvalidOptions {
message: String,
},
Unsupported {
feature: &'static str,
},
UnsupportedBackend {
feature: &'static str,
},
UnsupportedDurability {
requested: DurabilityMode,
},
}Expand description
Error returned by database, storage, recovery, and transaction operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
Underlying I/O error from the selected storage backend.
Corruption
Durable data failed an integrity or consistency check.
InvalidFormat
Bytes could not be decoded as a valid Trine storage record.
UnsupportedFormat
Bytes use a storage format that this crate version does not support.
The requested codec is not available in this build.
Conflict
An optimistic transaction conflicted with a committed write.
ReadOnly
The database was opened read-only and a write was requested.
Closed
The database handle is closed.
RuntimeBusy
The configured runtime cannot accept the requested work now.
BucketMissing
A named bucket required by durable metadata was not found.
InvalidOptions
Options were invalid or inconsistent.
Unsupported
A Trine feature is unavailable in the current runtime or build.
UnsupportedBackend
The selected storage backend does not provide a required capability.
UnsupportedDurability
The selected storage backend cannot provide the requested durability.
Fields
requested: DurabilityModeDurability mode requested by the caller.
Implementations§
Source§impl Error
impl Error
Sourcepub const fn unsupported(feature: &'static str) -> Self
pub const fn unsupported(feature: &'static str) -> Self
Creates an unsupported-feature error.
Sourcepub const fn unsupported_backend(feature: &'static str) -> Self
pub const fn unsupported_backend(feature: &'static str) -> Self
Creates an unsupported-backend error.
Sourcepub const fn unsupported_durability(requested: DurabilityMode) -> Self
pub const fn unsupported_durability(requested: DurabilityMode) -> Self
Creates an unsupported-durability error.
Sourcepub fn invalid_options(message: impl Into<String>) -> Self
pub fn invalid_options(message: impl Into<String>) -> Self
Creates an invalid-options error.
Examples found in repository?
More examples
Sourcepub fn runtime_busy(message: impl Into<String>) -> Self
pub fn runtime_busy(message: impl Into<String>) -> Self
Creates a runtime-busy error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()