Skip to main content

MemoryError

Enum MemoryError 

Source
pub enum MemoryError {
Show 37 variants Database(Error), EmbeddingRequest(Error), DimensionMismatch { expected: usize, actual: usize, }, EmbeddingBatchCountMismatch { requested: usize, returned: usize, }, EmbeddingDimensionMismatch { expected: usize, actual: usize, }, NonFiniteEmbeddingValue { index: usize, }, VectorBlobLengthMismatch { expected_bytes: usize, actual_bytes: usize, }, VectorCodecProfileMismatch { expected_digest: String, actual_digest: String, }, SearchReceiptConflict { receipt_id: String, }, DigestError(String), SearchReceiptNotFound { receipt_id: String, }, InvalidEmbedding { expected_bytes: usize, actual_bytes: usize, }, ModelMismatch { stored: String, configured: String, }, SessionNotFound(String), FactNotFound(String), DocumentNotFound(String), EmbedderUnavailable(String), MigrationFailed { version: u32, reason: String, }, HnswError(String), NotImplemented(String), InvalidKey(String), QuantizationError(String), StorageError(String), IntegrityError { in_sqlite_not_hnsw: usize, in_hnsw_not_sqlite: usize, }, SchemaAhead { found: u32, supported: u32, }, ContentTooLarge { size: usize, limit: usize, }, NamespaceFull { namespace: String, count: usize, limit: usize, }, DatabaseSizeLimitExceeded { current: u64, limit: u64, }, EpisodeNotFound(String), PoolTimeout { elapsed_ms: u64, pool_size: usize, }, VectorScanLimitExceeded { table: String, scanned: usize, limit: usize, }, InvalidConfig { field: &'static str, reason: String, }, CorruptData { table: &'static str, row_id: String, detail: String, }, ImportInvalid { reason: String, }, ImportDuplicate { envelope_id: String, }, ImportMigrationRequired { source_envelope_id: String, detail: String, }, Other(String),
}
Expand description

Error types for the semantic-memory crate.

All errors flow through MemoryError, using #[from] for automatic conversion from rusqlite and reqwest errors.

Variants§

§

Database(Error)

SQLite / rusqlite error.

§

EmbeddingRequest(Error)

HTTP error from the embedding provider.

§

DimensionMismatch

Embedding vector has wrong number of dimensions.

Fields

§expected: usize
§actual: usize
§

EmbeddingBatchCountMismatch

Embedding provider returned a different number of vectors than requested.

Fields

§requested: usize
§returned: usize
§

EmbeddingDimensionMismatch

Embedding vector has wrong number of dimensions.

Fields

§expected: usize
§actual: usize
§

NonFiniteEmbeddingValue

Embedding vector contains NaN or infinity.

Fields

§index: usize
§

VectorBlobLengthMismatch

Raw vector BLOB length does not match the expected f32 dimensions.

Fields

§expected_bytes: usize
§actual_bytes: usize
§

VectorCodecProfileMismatch

Encoded vector artifact was produced with a different codec profile.

Fields

§expected_digest: String

Digest required by the decoding codec.

§actual_digest: String

Digest carried by the encoded artifact.

§

SearchReceiptConflict

A durable search receipt ID already exists with different payload bytes.

Fields

§receipt_id: String

Conflicting receipt/request ID.

§

DigestError(String)

Canonical content digest computation failed.

§

SearchReceiptNotFound

A requested durable search receipt was not found.

Fields

§receipt_id: String

Requested receipt/request ID.

§

InvalidEmbedding

Raw BLOB data is not a valid embedding.

Fields

§expected_bytes: usize
§actual_bytes: usize
§

ModelMismatch

Database was created with a different embedding model.

Fields

§stored: String
§configured: String
§

SessionNotFound(String)

Session with the given ID does not exist.

§

FactNotFound(String)

Fact with the given ID does not exist.

§

DocumentNotFound(String)

Document with the given ID does not exist.

§

EmbedderUnavailable(String)

Embedding provider is unreachable or misconfigured.

§

MigrationFailed

Database migration failed.

Fields

§version: u32
§reason: String
§

HnswError(String)

HNSW index error.

§

NotImplemented(String)

Vector backend not yet implemented (e.g. usearch stub during migration).

§

InvalidKey(String)

Invalid HNSW key format.

§

QuantizationError(String)

Quantization error.

§

StorageError(String)

Storage path error.

§

IntegrityError

Index integrity check failed.

Fields

§in_sqlite_not_hnsw: usize
§in_hnsw_not_sqlite: usize
§

SchemaAhead

Database schema is newer than this library version can handle.

Fields

§found: u32

Schema version found in the database.

§supported: u32

Maximum version supported by this build.

§

ContentTooLarge

Content exceeds configured size limit.

Fields

§size: usize

Actual content size in bytes.

§limit: usize

Configured limit in bytes.

§

NamespaceFull

Namespace fact count would exceed the configured limit.

Fields

§namespace: String

Namespace that is full.

§count: usize

Current fact count.

§limit: usize

Configured limit.

§

DatabaseSizeLimitExceeded

The configured database size ceiling would be exceeded by a new write.

Fields

§current: u64

Current observed database footprint in bytes.

§limit: u64

Configured limit in bytes.

§

EpisodeNotFound(String)

Episode with the given ID does not exist.

§

PoolTimeout

Connection pool reader acquisition timed out.

Fields

§elapsed_ms: u64

How long the caller waited before giving up.

§pool_size: usize

Number of reader slots in the pool.

§

VectorScanLimitExceeded

Brute-force vector search would scan more rows than the configured hard limit.

Fields

§table: String

Logical table/collection being scanned.

§scanned: usize

Rows scanned before the circuit breaker tripped.

§limit: usize

Configured hard limit.

§

InvalidConfig

Configuration could not be normalized into a valid runtime state.

Fields

§field: &'static str

The config field or section that failed validation.

§reason: String

Human-readable explanation of the invalid value.

§

CorruptData

Stored data is malformed or internally inconsistent.

Fields

§table: &'static str

Table or logical collection containing the bad row.

§row_id: String

Primary key / row identifier for the corrupt record.

§detail: String

Human-readable description of the corruption.

§

ImportInvalid

Import envelope is structurally invalid.

Fields

§reason: String

What is wrong with the envelope.

§

ImportDuplicate

Import envelope has already been ingested (idempotent duplicate).

Fields

§envelope_id: String

The duplicate envelope ID.

§

ImportMigrationRequired

Import hit a historical digest/receipt drift seam and needs operator repair.

Fields

§source_envelope_id: String

The source envelope whose historical import receipts no longer line up.

§detail: String

Human-readable conflict details and operator guidance.

§

Other(String)

Catch-all for other errors.

Implementations§

Source§

impl MemoryError

Source

pub fn kind(&self) -> &'static str

Returns a stable string discriminant for programmatic matching.

Trait Implementations§

Source§

impl Debug for MemoryError

Source§

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

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

impl Display for MemoryError

Source§

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

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

impl Error for MemoryError

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<Error> for MemoryError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for MemoryError

Source§

fn from(source: Error) -> 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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