pub enum EmbedErrorPolicy {
Fail,
Degrade,
}Expand description
What a database does when its embedder cannot be reached.
The choice only ever concerns transport and provider failures
(HostError::Embed) — a refused connection, a timeout, a 500, a body
that is not the documented shape. A plugmem_core::Error::VectorSpaceMismatch is a
different thing entirely: the provider answered, and its answer does not
belong in this database. That stays an error under both policies, because
degrading it would mix two semantic spaces in one index, and no later
repair can tell the halves apart.
Variants§
Fail
Propagate the failure. A remember fails, a text recall fails, and
the caller decides what that means. The default, because it is what
every release so far did, and because silence is the wrong default for
a component whose job is to answer.
Degrade
Carry on without the vector, and suspend the embedder.
The write stores its fact with no vector, the recall answers from the
lexical, tag, graph and time sources — a smaller answer, never a wrong
one. Nothing is lost that cannot be recovered: the missing vectors are
exactly the state a database has when it is written with no embedder at
all, and crate::Database::reembed fills them in from the stored text.
The suspension is the other half, and it is the half that matters in practice. Without it every later call pays the same failure again — a full timeout each, on every recall of every turn — so the degraded mode would cost more than the error it replaced.
Trait Implementations§
Source§impl Clone for EmbedErrorPolicy
impl Clone for EmbedErrorPolicy
Source§fn clone(&self) -> EmbedErrorPolicy
fn clone(&self) -> EmbedErrorPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EmbedErrorPolicy
Source§impl Debug for EmbedErrorPolicy
impl Debug for EmbedErrorPolicy
Source§impl Default for EmbedErrorPolicy
impl Default for EmbedErrorPolicy
Source§fn default() -> EmbedErrorPolicy
fn default() -> EmbedErrorPolicy
impl Eq for EmbedErrorPolicy
Source§impl PartialEq for EmbedErrorPolicy
impl PartialEq for EmbedErrorPolicy
impl StructuralPartialEq for EmbedErrorPolicy
Auto Trait Implementations§
impl Freeze for EmbedErrorPolicy
impl RefUnwindSafe for EmbedErrorPolicy
impl Send for EmbedErrorPolicy
impl Sync for EmbedErrorPolicy
impl Unpin for EmbedErrorPolicy
impl UnsafeUnpin for EmbedErrorPolicy
impl UnwindSafe for EmbedErrorPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.