DbError

Enum DbError 

Source
pub enum DbError {
Show 26 variants ConnectionFailed { endpoint: String, reason: String, }, BufferFull { size: u32, buffer_name: String, }, BufferLagged { lag_count: u64, buffer_name: String, }, BufferClosed { buffer_name: String, }, RecordNotFound { record_name: String, }, RecordKeyNotFound { key: String, }, InvalidRecordId { id: u32, }, TypeMismatch { record_id: u32, expected_type: String, }, AmbiguousType { count: u32, type_name: String, }, DuplicateRecordKey { key: String, }, InvalidOperation { operation: String, reason: String, }, PermissionDenied { operation: String, }, MissingConfiguration { parameter: String, }, RuntimeError { message: String, }, ResourceUnavailable { resource_type: u8, resource_name: String, }, HardwareError { component: u8, error_code: u16, description: String, }, Internal { code: u32, message: String, }, AttachFailed { message: String, }, DetachFailed { message: String, }, SetTimeout, GetTimeout, RuntimeShutdown, Io { source: Error, }, IoWithContext { context: String, source: Error, }, Json { source: Error, }, JsonWithContext { context: String, source: Error, },
}
Expand description

Streamlined error type for AimDB operations

Only includes errors that are actually used in the codebase, removing theoretical/unused error variants for simplicity.

Variants§

§

ConnectionFailed

Connection or timeout failures

Fields

§endpoint: String
§reason: String
§

BufferFull

Buffer is full and cannot accept more items

Fields

§size: u32
§buffer_name: String
§

BufferLagged

Consumer lagged behind producer (SPMC ring buffers)

Fields

§lag_count: u64
§buffer_name: String
§

BufferClosed

Buffer channel has been closed (shutdown)

Fields

§buffer_name: String
§

RecordNotFound

Record type not found in database (legacy, by type name)

Fields

§record_name: String
§

RecordKeyNotFound

Record key not found in registry

Fields

§

InvalidRecordId

RecordId out of bounds or invalid

Fields

§id: u32
§

TypeMismatch

Type mismatch when accessing record by ID

Fields

§record_id: u32
§expected_type: String
§

AmbiguousType

Multiple records of same type exist (ambiguous type-only lookup)

Fields

§count: u32
§type_name: String
§

DuplicateRecordKey

Duplicate record key during registration

Fields

§

InvalidOperation

Invalid operation attempted

Fields

§operation: String
§reason: String
§

PermissionDenied

Permission denied for operation

Fields

§operation: String
§

MissingConfiguration

Missing required configuration parameter

Fields

§parameter: String
§

RuntimeError

Runtime execution error (task spawning, scheduling, etc.)

Fields

§message: String
§

ResourceUnavailable

Resource temporarily unavailable (used by adapters)

Fields

§resource_type: u8
§resource_name: String
§

HardwareError

Hardware-specific errors for embedded/MCU environments

Fields

§component: u8
§error_code: u16
§description: String
§

Internal

Internal error for unexpected conditions

Fields

§code: u32
§message: String
§

AttachFailed

Failed to attach database to runtime thread

Fields

§message: String
§

DetachFailed

Failed to detach database from runtime thread

Fields

§message: String
§

SetTimeout

Timeout while setting a value

§

GetTimeout

Timeout while getting a value

§

RuntimeShutdown

Runtime thread has shut down

§

Io

I/O operation error

Fields

§source: Error
§

IoWithContext

I/O operation error with context

Fields

§context: String
§source: Error
§

Json

JSON serialization error

Fields

§source: Error
§

JsonWithContext

JSON serialization error with context

Fields

§context: String
§source: Error

Implementations§

Source§

impl DbError

Source

pub const RESOURCE_TYPE_MEMORY: u8 = 0u8

Source

pub const RESOURCE_TYPE_FILE_HANDLE: u8 = 1u8

Source

pub const RESOURCE_TYPE_SOCKET: u8 = 2u8

Source

pub const RESOURCE_TYPE_BUFFER: u8 = 3u8

Source

pub const RESOURCE_TYPE_THREAD: u8 = 4u8

Source

pub const RESOURCE_TYPE_MUTEX: u8 = 5u8

Source

pub const RESOURCE_TYPE_SEMAPHORE: u8 = 6u8

Source

pub const RESOURCE_TYPE_CHANNEL: u8 = 7u8

Source

pub const RESOURCE_TYPE_WOULD_BLOCK: u8 = 255u8

Source

pub fn hardware_error(component: u8, error_code: u16) -> Self

Creates a hardware error for embedded environments

Source

pub fn internal(code: u32) -> Self

Creates an internal error with a specific error code

Source

pub fn is_network_error(&self) -> bool

Returns true if this is a network-related error

Source

pub fn is_capacity_error(&self) -> bool

Returns true if this is a capacity-related error

Source

pub fn is_hardware_error(&self) -> bool

Returns true if this is a hardware-related error

Source

pub const fn error_code(&self) -> u32

Returns a numeric error code for embedded environments

Source

pub const fn error_category(&self) -> u32

Returns the error category (high nibble)

Source

pub fn with_context<S: Into<String>>(self, context: S) -> Self

Adds additional context to an error (std only)

Source

pub fn into_anyhow(self) -> Error

Converts this error into an anyhow::Error (std only)

Trait Implementations§

Source§

impl Debug for DbError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DbError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for DbError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<DbError> for RemoteError

Source§

fn from(err: DbError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for DbError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for DbError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ExecutorError> for DbError

Convert executor errors to database errors

This allows runtime adapters to return ExecutorError while the core database works with DbError for consistency across the API.

Source§

fn from(err: ExecutorError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.