pub struct SearchService { /* private fields */ }Available on crate feature
experimental-search only.Expand description
A reactive, paginated search across all the user’s data.
Implementations§
Source§impl SearchService
impl SearchService
Sourcepub fn new(client: Client) -> Self
pub fn new(client: Client) -> Self
Create a new SearchService for the given client.
Sourcepub async fn set_query(&self, query: String) -> Result<(), SearchError>
pub async fn set_query(&self, query: String) -> Result<(), SearchError>
Set (or update) the search query.
Clears the current results, restarts pagination from scratch and loads
the first page. Call Self::paginate to load any further pages.
Sourcepub fn pagination_state(&self) -> PaginationState
pub fn pagination_state(&self) -> PaginationState
Returns the current pagination state.
Sourcepub fn subscribe_to_pagination_state_updates(
&self,
) -> Subscriber<PaginationState>
pub fn subscribe_to_pagination_state_updates( &self, ) -> Subscriber<PaginationState>
Subscribe to pagination state updates.
Sourcepub async fn results(&self) -> Vec<ResultType>
pub async fn results(&self) -> Vec<ResultType>
Return the current list of results.
Sourcepub async fn subscribe_to_results(
&self,
) -> (Vector<ResultType>, VectorSubscriberBatchedStream<ResultType>)
pub async fn subscribe_to_results( &self, ) -> (Vector<ResultType>, VectorSubscriberBatchedStream<ResultType>)
Subscribe to result list updates.
Sourcepub async fn paginate(&self) -> Result<(), SearchError>
pub async fn paginate(&self) -> Result<(), SearchError>
Load the next page of results, appending them to the list.
Auto Trait Implementations§
impl !Freeze for SearchService
impl !RefUnwindSafe for SearchService
impl Send for SearchService
impl Sync for SearchService
impl Unpin for SearchService
impl UnsafeUnpin for SearchService
impl !UnwindSafe for SearchService
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read moreSource§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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