pub struct SearchEngine { /* private fields */ }
Implementations§
Source§impl SearchEngine
impl SearchEngine
Sourcepub fn new(client: Context7Client) -> Self
pub fn new(client: Context7Client) -> Self
Create SearchEngine without embeddings (fallback mode)
Sourcepub async fn with_embeddings(client: Context7Client) -> Result<Self>
pub async fn with_embeddings(client: Context7Client) -> Result<Self>
Create SearchEngine with semantic embeddings
Sourcepub fn has_embeddings(&self) -> bool
pub fn has_embeddings(&self) -> bool
Check if semantic embeddings are available
pub async fn search( &self, library: &str, query: &str, limit: Option<usize>, ) -> Result<(Vec<SearchResult>, String, String)>
pub async fn get_documentation( &self, library: &str, query: Option<&str>, ) -> Result<String>
Auto Trait Implementations§
impl !Freeze for SearchEngine
impl !RefUnwindSafe for SearchEngine
impl Send for SearchEngine
impl Sync for SearchEngine
impl Unpin for SearchEngine
impl !UnwindSafe for SearchEngine
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> 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