Skip to main content

Module drive_dispatcher

Module drive_dispatcher 

Source
Expand description

Top-level dispatcher for the unified GetDocumentsCount request.

Owns the whole pipeline: CBOR-decode → mode detection → per-mode executor (see super::executors) → response wrapping. The drive-abci handler builds a DocumentCountRequest and calls Drive::execute_document_count_request; everything past contract lookup lives in drive.

Both DocumentCountRequest and DocumentCountResponse are the ABI for this dispatcher — they’re public so drive-abci can name the input/output types without reaching into the executor surface.

Module is gated feature = "server" via the parent’s pub mod drive_dispatcher; declaration.

Structs§

DocumentCountRequest
All inputs required for the unified document-count entry point Drive::execute_document_count_request. Built by the gRPC handler from a GetDocumentsRequestV1 after wire-decoding + contract lookup; drive owns everything past this point including mode-detection-from-clauses, index picking, and per-mode dispatch.

Enums§

DocumentCountResponse
Output shape of Drive::execute_document_count_request. Three variants mirror the proto’s CountResults.variant oneof (for no-proof responses) plus the outer Proof arm:

Functions§

order_clauses_from_value
Parse the decoded order_by value into structured OrderClauses.
validate_and_canonicalize_where_clauses
Run the system-wide where-clause validator on a structured Vec<WhereClause> and canonicalize same-field range pairs into their between* form. Single source of truth for the count-endpoint shape contract; called both from the legacy CBOR-decoded entry where_clauses_from_value and from the dispatcher’s typed entry, Drive::execute_document_count_request.
where_clauses_from_value
Parse the decoded where value into structured WhereClauses.