pub struct SearchResultEnvelope<'a> {
pub total: usize,
pub returned: usize,
pub offset: usize,
pub total_tokens: usize,
pub hits: Vec<SearchHitEnvelope<'a>>,
pub facets: Option<&'a Facets>,
pub warnings: &'a Vec<WarningHint>,
}Expand description
Envelope for a full SearchResult:
_-prefixed engine-emitted counters at the top level, facets
as a structured object (not a markdown blob), and the full per-hit
shape (score, score_breakdown, matched_terms, expansion) inherited
verbatim from SearchHit so the structured envelope is the
branching surface — agents reading structured_content don’t have
to parse the text channel’s rendered prose to recover scores or
score components. CLI --json and MCP structured_content share
this shape.
Fields§
§total: usize§returned: usize§offset: usize§total_tokens: usizeSum of estimated tokens across all matching entities (pre-pagination).
Mirrors ListResultEnvelope.total_tokens so the field has consistent
meaning across both surfaces — migration cost for agents is zero.
hits: Vec<SearchHitEnvelope<'a>>§facets: Option<&'a Facets>Faceted counts over the unpaginated hit set. Skipped on the
wire when the engine produced no facets (rare; the unified
engine always populates an empty Facets::default() for
shape stability).
warnings: &'a Vec<WarningHint>Trait Implementations§
Source§impl<'a> Serialize for SearchResultEnvelope<'a>
impl<'a> Serialize for SearchResultEnvelope<'a>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl<'a> Freeze for SearchResultEnvelope<'a>
impl<'a> RefUnwindSafe for SearchResultEnvelope<'a>
impl<'a> Send for SearchResultEnvelope<'a>
impl<'a> Sync for SearchResultEnvelope<'a>
impl<'a> Unpin for SearchResultEnvelope<'a>
impl<'a> UnsafeUnpin for SearchResultEnvelope<'a>
impl<'a> UnwindSafe for SearchResultEnvelope<'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
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>
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>
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)
&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)
&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
impl<T> Fruit for T
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> ⓘ
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> ⓘ
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