pub struct SearchResults<'a> { /* private fields */ }Expand description
Deterministic search outcome. truncated is true whenever any matching
entry was withheld by the count or byte budget, so callers never mistake
a bounded result for the complete one.
Implementations§
Source§impl<'a> SearchResults<'a>
impl<'a> SearchResults<'a>
Sourcepub fn generation(&self) -> CatalogGeneration
pub fn generation(&self) -> CatalogGeneration
The catalog generation this index snapshot was built from.
pub fn hits(&self) -> &[&'a DiscoveryEntry]
Sourcepub fn serialized_bytes(&self) -> usize
pub fn serialized_bytes(&self) -> usize
Exact compact-JSON byte size of the returned hit collection serialized
as an array — equal to serde_json::to_vec(self.hits()).len(),
including the [/] container (2 bytes when empty) and separating
commas. Always ≤ the byte budget the search ran with.
pub fn truncated(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SearchResults<'a>
impl<'a> RefUnwindSafe for SearchResults<'a>
impl<'a> Send for SearchResults<'a>
impl<'a> Sync for SearchResults<'a>
impl<'a> Unpin for SearchResults<'a>
impl<'a> UnsafeUnpin for SearchResults<'a>
impl<'a> UnwindSafe for SearchResults<'a>
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> 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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.