pub struct QueryEmbedding {
pub embedding: Option<Vec<f32>>,
pub degraded: bool,
pub error: Option<String>,
pub backend_invoked: Option<&'static str>,
pub reason_code: Option<&'static str>,
}Expand description
Live query embedding plus the flags describing whether it succeeded.
backend_invoked names the backend that actually ran, and is None both
when the caller opted out and when every attempt failed.
Was a four-element tuple until v1.2.5. It became a struct when reason_code
was added because the field next to it, backend_invoked, has the SAME type:
two adjacent Option<&'static str> in a tuple swap silently, the compiler
accepts it, and the only symptom is a degradation classified as the wrong
error. A named field makes that swap impossible to write.
reason_code is the machine-readable half of error, and it exists because
degradation_failure derives the error class from the code and never from
the prose. Until v1.2.5 this resolver logged the code and threw it away, so
no caller could satisfy that contract — which is why --fail-on-degraded
shipped declared, documented and never once consulted.
Fields§
§embedding: Option<Vec<f32>>The query vector, or None when the read degraded to FTS5-only.
degraded: boolWhether the read fell back to BM25 alone.
error: Option<String>Operator-facing prose for the degradation.
backend_invoked: Option<&'static str>Backend that actually produced the vector.
reason_code: Option<&'static str>Stable code for the degradation, None when nothing degraded.
Auto Trait Implementations§
impl Freeze for QueryEmbedding
impl RefUnwindSafe for QueryEmbedding
impl Send for QueryEmbedding
impl Sync for QueryEmbedding
impl Unpin for QueryEmbedding
impl UnsafeUnpin for QueryEmbedding
impl UnwindSafe for QueryEmbedding
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> ErasedDestructor for Twhere
T: 'static,
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