pub trait DaemonClient: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn is_available(&self) -> bool;
fn embed(
&self,
text: &str,
request_id: &str,
) -> Result<Vec<f32>, DaemonError>;
fn embed_batch(
&self,
texts: &[&str],
request_id: &str,
) -> Result<Vec<Vec<f32>>, DaemonError>;
fn rerank(
&self,
query: &str,
documents: &[&str],
request_id: &str,
) -> Result<Vec<f32>, DaemonError>;
}Expand description
Abstract daemon client.
Concrete transports (e.g. UDS/HTTP) are implemented by host applications.
Required Methods§
fn id(&self) -> &str
fn is_available(&self) -> bool
fn embed(&self, text: &str, request_id: &str) -> Result<Vec<f32>, DaemonError>
fn embed_batch( &self, texts: &[&str], request_id: &str, ) -> Result<Vec<Vec<f32>>, DaemonError>
fn rerank( &self, query: &str, documents: &[&str], request_id: &str, ) -> Result<Vec<f32>, DaemonError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".