pub struct FailingEmbedder {
pub wrong_row_count: bool,
/* private fields */
}Expand description
Always-failing Embedder for use in unit tests that must verify error
propagation. Every embed_batch call returns
LunarisError::Storage(StorageError::Backend(...)).
Use wrong_row_count: true to simulate a wrong-row-count return instead
of a hard Err.
Fields§
§wrong_row_count: boolWhen true, returns Ok with inputs.len() + 1 vectors instead of
Err — exercises the row-count mismatch arm.
Implementations§
Source§impl FailingEmbedder
impl FailingEmbedder
Sourcepub fn new(dim: usize) -> FailingEmbedder
pub fn new(dim: usize) -> FailingEmbedder
Construct an embedder that always errors.
Sourcepub fn wrong_count(dim: usize) -> FailingEmbedder
pub fn wrong_count(dim: usize) -> FailingEmbedder
Construct an embedder that returns the wrong row count.
Trait Implementations§
Source§impl Clone for FailingEmbedder
impl Clone for FailingEmbedder
Source§fn clone(&self) -> FailingEmbedder
fn clone(&self) -> FailingEmbedder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FailingEmbedder
impl Debug for FailingEmbedder
Source§impl Embedder for FailingEmbedder
impl Embedder for FailingEmbedder
fn dim(&self) -> usize
fn embed_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
inputs: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>, LunarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
FailingEmbedder: 'async_trait,
Source§fn embed_batch_lowpri<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
inputs: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>, LunarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn embed_batch_lowpri<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
inputs: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>, LunarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Lower-priority batch embed for background/bulk work (e.g. ingest
promotion). Semantically identical to
Embedder::embed_batch — same
vectors, same order — but signals the embedder may defer this batch
behind interactive recall queries. The default just delegates; only a
backend with an internal scheduler (the llama.cpp worker) overrides it
to ride a background lane so ingest never head-of-line-blocks recall.Auto Trait Implementations§
impl Freeze for FailingEmbedder
impl RefUnwindSafe for FailingEmbedder
impl Send for FailingEmbedder
impl Sync for FailingEmbedder
impl Unpin for FailingEmbedder
impl UnsafeUnpin for FailingEmbedder
impl UnwindSafe for FailingEmbedder
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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