#[non_exhaustive]pub enum InstanceError {
Show 27 variants
DatabaseNotFound {
name: String,
},
DatabaseAlreadyExists {
name: String,
},
InstanceAlreadyExists,
EntryNotInDatabase {
entry_id: ID,
database_id: ID,
},
EntryNotFound {
entry_id: ID,
},
TransactionAlreadyCommitted,
EmptyTipsNotAllowed,
InvalidTip {
tip_id: ID,
database_id: ID,
},
SigningKeyNotFound {
key_name: String,
},
AuthenticationRequired,
DeviceKeyNotFound,
NoAuthConfiguration,
AuthenticationValidationFailed {
reason: String,
},
InsufficientPermissions,
SignatureVerificationFailed,
InvalidDataType {
expected: String,
actual: String,
},
SerializationFailed {
context: String,
},
InvalidDatabaseConfiguration {
reason: String,
},
SettingsValidationFailed {
reason: String,
},
InvalidOperation {
reason: String,
},
DatabaseInitializationFailed {
reason: String,
},
EntryValidationFailed {
reason: String,
},
DatabaseStateCorruption {
reason: String,
},
OperationNotSupported {
operation: String,
},
InstanceDropped,
SyncAlreadyEnabled,
SystemDatabaseNotFound {
database_name: String,
},
}Expand description
Errors that can occur during base database operations.
§Stability
- New variants may be added in minor versions (enum is
#[non_exhaustive]) - Existing variants will not be removed in minor versions
- Field additions/changes require a major version bump
- Helper methods like
is_*()provide stable APIs
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DatabaseNotFound
Database not found by name.
DatabaseAlreadyExists
Database already exists with the given name.
InstanceAlreadyExists
Instance already exists on this backend.
EntryNotInDatabase
Entry does not belong to the specified database.
EntryNotFound
Entry not found by ID.
TransactionAlreadyCommitted
Transaction has already been committed and cannot be modified.
EmptyTipsNotAllowed
Cannot create transaction with empty tips.
InvalidTip
Tip entry does not belong to the specified database.
SigningKeyNotFound
Signing key not found in backend storage.
AuthenticationRequired
Authentication is required but no key is configured.
DeviceKeyNotFound
Device key not found in instance metadata.
NoAuthConfiguration
No authentication configuration found.
AuthenticationValidationFailed
Authentication validation failed.
InsufficientPermissions
Insufficient permissions for the requested operation.
SignatureVerificationFailed
Signature verification failed.
InvalidDataType
Invalid data type encountered.
SerializationFailed
Serialization failed.
InvalidDatabaseConfiguration
Invalid database configuration.
SettingsValidationFailed
Settings validation failed.
InvalidOperation
Invalid operation attempted.
DatabaseInitializationFailed
Database initialization failed.
EntryValidationFailed
Entry validation failed.
DatabaseStateCorruption
Database state is corrupted or inconsistent.
OperationNotSupported
Operation is not supported in the current mode or not yet implemented.
InstanceDropped
Instance has been dropped and is no longer available.
SyncAlreadyEnabled
Sync has already been enabled on this Instance.
SystemDatabaseNotFound
System database not found during instance initialization.
Implementations§
Source§impl InstanceError
impl InstanceError
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if this error indicates a resource was not found.
Sourcepub fn is_already_exists(&self) -> bool
pub fn is_already_exists(&self) -> bool
Check if this error indicates a resource already exists.
Sourcepub fn is_authentication_error(&self) -> bool
pub fn is_authentication_error(&self) -> bool
Check if this error is authentication-related.
Sourcepub fn is_operation_error(&self) -> bool
pub fn is_operation_error(&self) -> bool
Check if this error is operation-related.
Sourcepub fn is_validation_error(&self) -> bool
pub fn is_validation_error(&self) -> bool
Check if this error is validation-related.
Sourcepub fn is_corruption_error(&self) -> bool
pub fn is_corruption_error(&self) -> bool
Check if this error indicates corruption or inconsistency.
Sourcepub fn entry_id(&self) -> Option<&ID>
pub fn entry_id(&self) -> Option<&ID>
Get the entry ID if this error is about a specific entry.
Sourcepub fn database_id(&self) -> Option<&ID>
pub fn database_id(&self) -> Option<&ID>
Get the database ID if this error is about a specific database.
Sourcepub fn database_name(&self) -> Option<&str>
pub fn database_name(&self) -> Option<&str>
Get the database name if this error is about a named database.
Trait Implementations§
Source§impl Debug for InstanceError
impl Debug for InstanceError
Source§impl Display for InstanceError
impl Display for InstanceError
Source§impl Error for InstanceError
impl Error for InstanceError
1.30.0 · 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
Source§impl From<InstanceError> for Error
impl From<InstanceError> for Error
Source§fn from(err: InstanceError) -> Self
fn from(err: InstanceError) -> Self
Auto Trait Implementations§
impl Freeze for InstanceError
impl RefUnwindSafe for InstanceError
impl Send for InstanceError
impl Sync for InstanceError
impl Unpin for InstanceError
impl UnwindSafe for InstanceError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.