Skip to main content

ExecData

Enum ExecData 

Source
pub enum ExecData {
    Hits(Vec<SearchHit>),
    Groups(Vec<GroupedSearchResult>),
    Count(u64),
    Facet(Vec<FacetHit>),
    Mutation {
        affected: Option<u64>,
    },
    Collections(Vec<String>),
    Collection(CollectionInfo),
    ShardKeys(Vec<PlanShardKey>),
    Quotas(QuotaConfig),
}
Expand description

Transport-neutral typed payload of one operation result. Closed by construction: every backend response shape the transports can produce has a variant here — there is no JSON passthrough.

Serialization emits the report JSON shapes SDK consumers already read: Hits → array of SearchHit, Groups → {"groups": [{"id", "hits"}]}, Count → {"count": n}, Facet → array of {"value": …, "count": n}, Mutation { affected: Some(n) } → {"count": n}, Mutation { affected: None } → null, Collections → {"collections": ["name", …]}, Collection → the CollectionInfo object, ShardKeys → {"shard_keys": [key, …]}, Quotas → the QuotaConfig object.

Variants§

§

Hits(Vec<SearchHit>)

Query / scroll / retrieve hits, in backend order.

§

Groups(Vec<GroupedSearchResult>)

Grouped query results (QUERY … GROUP BY).

§

Count(u64)

COUNT result.

§

Facet(Vec<FacetHit>)

FACET entries.

§

Mutation

Write-op outcome: affected: Some(n) for upsert (n points written), None for status-only mutations (delete, payload/vector updates).

Fields

§affected: Option<u64>

Number of points written, when the operation reports one.

§

Collections(Vec<String>)

Collection names (SHOW COLLECTIONS).

§

Collection(CollectionInfo)

Collection metadata (SHOW COLLECTION).

§

ShardKeys(Vec<PlanShardKey>)

Custom shard keys (SHOW SHARD KEYS).

§

Quotas(QuotaConfig)

Cluster-wide quota configuration (SHOW QUOTAS / SET QUOTA).

Implementations§

Source§

impl ExecData

Source

pub fn hits(&self) -> Option<&[SearchHit]>

Borrow hits when this is a ExecData::Hits payload. A query that found nothing still yields Some(&[]), matching the pre-typing hits() contract.

Source

pub fn groups(&self) -> Option<&[GroupedSearchResult]>

Borrow grouped results when this is an ExecData::Groups payload.

Source

pub fn count(&self) -> Option<u64>

The integer when this is a ExecData::Count payload, or the affected point count of an upsert ExecData::Mutation.

Source

pub fn mutation_affected(&self) -> Option<Option<u64>>

The affected-point count of an ExecData::Mutation: Some(Some(n)) for an upsert, Some(None) for a status-only write, None otherwise.

Source

pub fn facet(&self) -> Option<&[FacetHit]>

Borrow facet entries when this is a ExecData::Facet payload.

Source

pub fn collections(&self) -> Option<&[String]>

Borrow collection names when this is a ExecData::Collections payload.

Source

pub fn collection(&self) -> Option<&CollectionInfo>

Borrow collection metadata when this is an ExecData::Collection payload.

Source

pub fn shard_keys(&self) -> Option<&[PlanShardKey]>

Borrow custom shard keys when this is an ExecData::ShardKeys payload.

Source

pub fn quotas(&self) -> Option<&QuotaConfig>

Borrow the quota configuration when this is a ExecData::Quotas payload.

Source

pub fn is_empty(&self) -> bool

Whether the payload carries no records: empty Hits/Groups/Facet/Collections/ShardKeys. Count, Mutation, Collection, and Quotas are never empty (a zero count or an unlimited quota config is a result).

Trait Implementations§

Source§

impl Clone for ExecData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExecData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ExecData

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ExecData

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ExecData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.