pub enum NoxuError {
Show 43 variants
EnvironmentFailure {
reason: EnvironmentFailureReason,
msg: String,
},
EnvironmentWedged(String),
EnvironmentNotFound(String),
EnvironmentLocked(String),
LogWriteFailure(String),
DiskLimitExceeded {
used: u64,
limit: u64,
},
ThreadInterrupted,
DatabaseNotFound(String),
DatabaseAlreadyExists(String),
DatabaseClosed,
EnvironmentClosed,
CursorClosed,
LockConflict(String),
DeadlockDetected,
LockTimeout {
timeout_ms: u64,
detail: String,
},
LockNotAvailable,
TransactionTimeout {
timeout_ms: u64,
txn_id: i64,
},
LockPreempted,
TransactionAborted(String),
KeyExists,
UniqueConstraintViolation(String),
DeleteConstraintViolation(String),
ForeignConstraintViolation(String),
DuplicateDataException,
SecondaryIntegrityException(String),
SequenceExists(String),
SequenceNotFound(String),
SequenceOverflow,
SequenceIntegrity(String),
NotFound,
ReadOnly,
ReplicaWrite,
InsufficientReplicas {
required: u32,
available: u32,
},
RollbackRequired(String),
LogChecksumMismatch(String),
LogFileNotFound(String),
IoError(Error),
VersionMismatch(String),
OperationNotAllowed(String),
IllegalArgument(String),
Timeout,
InvalidOperation(String),
Unsupported(String),
}Expand description
Errors that can occur when using Noxu DB.
Implements exception hierarchy:
NoxuError::EnvironmentFailure— potentially fatal; checkNoxuError::is_fatal_to_environment. Carries anEnvironmentFailureReasonfor discriminating the cause.- Operation-failure variants are retryable after abort
(
NoxuError::is_retryable). - HA / replication variants (
NoxuError::InsufficientReplicas,NoxuError::ReplicaWrite,NoxuError::RollbackRequired).
Variants§
EnvironmentFailure
A failure has occurred that may require the environment to be closed
and re-opened. Check NoxuError::is_fatal_to_environment /
NoxuError::reason to determine whether restart is required.
Fields
reason: EnvironmentFailureReasonThe root cause of the failure.
EnvironmentWedged(String)
The environment is permanently wedged and cannot recover even after close/re-open. Operator intervention or backup restore is required.
EnvironmentNotFound(String)
The environment home directory was not found and allow_create = false.
EnvironmentLocked(String)
The environment is already open by another process.
LogWriteFailure(String)
An I/O error occurred while writing to the log. The disk may be full.
DiskLimitExceeded
The disk limit (MAX_DISK / FREE_DISK) was exceeded.
ThreadInterrupted
The calling thread was interrupted while performing a
DatabaseNotFound(String)
The requested database was not found in the environment.
DatabaseAlreadyExists(String)
An attempt was made to create a database that already exists.
DatabaseClosed
An operation was attempted on a closed database.
EnvironmentClosed
An operation was attempted on a closed environment.
CursorClosed
An operation was attempted on a closed cursor.
LockConflict(String)
A lock conflict occurred (locker blocked and could not acquire).
Retryable.
DeadlockDetected
A deadlock was detected between two or more transactions.
Retryable.
LockTimeout
A lock-wait timeout expired.
Retryable.
Fields
LockNotAvailable
A lock was requested with no-wait semantics and was not immediately
available.
Retryable.
TransactionTimeout
A transaction-level timeout expired.
Retryable.
Fields
LockPreempted
A lock was preempted by a higher-priority locker (HA).
Retryable.
TransactionAborted(String)
The transaction was aborted.
KeyExists
The key already exists (put_no_overwrite / cursor put_no_dup_data).
UniqueConstraintViolation(String)
A unique-index constraint was violated.
DeleteConstraintViolation(String)
A delete was attempted on a primary record referenced by a secondary index.
ForeignConstraintViolation(String)
A foreign-key constraint was violated.
DuplicateDataException
Duplicate data was supplied to a putNoDupData operation in a
duplicate-sorted database.
SecondaryIntegrityException(String)
A secondary database integrity constraint was violated.
SequenceExists(String)
A sequence with the given name already exists.
SequenceNotFound(String)
A sequence with the given name was not found.
SequenceOverflow
A sequence has overflowed or underflowed its range.
SequenceIntegrity(String)
A sequence integrity violation was detected.
NotFound
A key or data item was not found.
ReadOnly
The database or environment is in read-only mode.
ReplicaWrite
A write was attempted on a replica node.
InsufficientReplicas
Insufficient replicas acknowledged the commit.
Fields
RollbackRequired(String)
The transaction must be rolled back due to a replication state change.
LogChecksumMismatch(String)
A log checksum mismatch was detected (potential corruption).
Fatal: the environment will be invalidated.
LogFileNotFound(String)
A log file was not found.
IoError(Error)
An I/O error occurred.
VersionMismatch(String)
A version mismatch occurred (e.g. on-disk format vs. code version).
OperationNotAllowed(String)
The operation is not allowed in the current state.
IllegalArgument(String)
An illegal argument was provided to a method.
Mirrors IllegalArgumentException (DB flavour).
Timeout
The operation timed out (non-lock, non-txn — e.g. network or sync).
InvalidOperation(String)
An invalid operation was requested.
Unsupported(String)
The requested operation is recognised by the API but not yet
implemented. The argument names the operation (for example
"Get::SearchLte").
Returned by API arms that previously fell through to a silent
OperationStatus::NotFound; users now see a loud, typed error
instead of a misleading miss. Tracked in
docs/src/internal/api-audit-2026-05-cursor.md Finding 3.
Implementations§
Source§impl NoxuError
impl NoxuError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if the failed operation may be retried after aborting
the current transaction.
Mirrors OperationFailureException.isRetryable().
Sourcepub fn is_fatal_to_environment(&self) -> bool
pub fn is_fatal_to_environment(&self) -> bool
Returns true if this error is fatal to the environment.
After a fatal error the environment must be closed and re-opened.
Subsequent operations on an invalidated environment will return
EnvironmentClosed.
Mirrors EnvironmentFailureException detection + isValid().
Sourcepub fn reason(&self) -> Option<&EnvironmentFailureReason>
pub fn reason(&self) -> Option<&EnvironmentFailureReason>
Returns the EnvironmentFailureReason if this is an
EnvironmentFailure variant, None otherwise.
Mirrors EnvironmentFailureException.getReason().
Sourcepub fn is_corrupted(&self) -> bool
pub fn is_corrupted(&self) -> bool
Returns true if the environment log is persistently corrupted.
Mirrors EnvironmentFailureException.isCorrupted().
Sourcepub fn is_lock_conflict(&self) -> bool
pub fn is_lock_conflict(&self) -> bool
Returns true if this is a lock-conflict error.
Sourcepub fn is_lock_timeout(&self) -> bool
pub fn is_lock_timeout(&self) -> bool
Returns true if this is a lock or transaction timeout.
Sourcepub fn is_database_not_found(&self) -> bool
pub fn is_database_not_found(&self) -> bool
Returns true if the named database was not found.
Sourcepub fn is_operation_failure(&self) -> bool
pub fn is_operation_failure(&self) -> bool
Returns true for any OperationFailureException-equivalent.
Sourcepub fn environment(msg: impl Into<String>) -> NoxuError
pub fn environment(msg: impl Into<String>) -> NoxuError
Creates an EnvironmentFailure with UnexpectedState reason.
Use when the specific reason is unknown.
Sourcepub fn environment_with_reason(
reason: EnvironmentFailureReason,
msg: impl Into<String>,
) -> NoxuError
pub fn environment_with_reason( reason: EnvironmentFailureReason, msg: impl Into<String>, ) -> NoxuError
Creates an EnvironmentFailure with an explicit reason.
Sourcepub fn invalid_argument(msg: impl Into<String>) -> NoxuError
pub fn invalid_argument(msg: impl Into<String>) -> NoxuError
Creates an IllegalArgument error.
Sourcepub fn lock_conflict(msg: impl Into<String>) -> NoxuError
pub fn lock_conflict(msg: impl Into<String>) -> NoxuError
Creates a LockConflict error.
Sourcepub fn lock_timeout(timeout_ms: u64) -> NoxuError
pub fn lock_timeout(timeout_ms: u64) -> NoxuError
Creates a LockTimeout error.
Sourcepub fn database_not_found(name: impl Into<String>) -> NoxuError
pub fn database_not_found(name: impl Into<String>) -> NoxuError
Creates a DatabaseNotFound error.
Sourcepub fn disk_limit_exceeded(used: u64, limit: u64) -> NoxuError
pub fn disk_limit_exceeded(used: u64, limit: u64) -> NoxuError
Creates a DiskLimitExceeded error.
Trait Implementations§
Source§impl Error for NoxuError
impl Error for NoxuError
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()
Source§impl From<NoxuError> for CollectionError
impl From<NoxuError> for CollectionError
Source§fn from(source: NoxuError) -> CollectionError
fn from(source: NoxuError) -> CollectionError
Source§impl From<NoxuError> for PersistError
impl From<NoxuError> for PersistError
Source§fn from(source: NoxuError) -> PersistError
fn from(source: NoxuError) -> PersistError
Auto Trait Implementations§
impl !RefUnwindSafe for NoxuError
impl !UnwindSafe for NoxuError
impl Freeze for NoxuError
impl Send for NoxuError
impl Sync for NoxuError
impl Unpin for NoxuError
impl UnsafeUnpin for NoxuError
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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