Skip to main content

DriveDocumentSumQuery

Struct DriveDocumentSumQuery 

Source
pub struct DriveDocumentSumQuery<'a> {
    pub document_type: DocumentTypeRef<'a>,
    pub contract_id: [u8; 32],
    pub document_type_name: String,
    pub index: &'a Index,
    pub where_clauses: Vec<WhereClause>,
    pub sum_property: String,
}
Expand description

Compiled sum-query object. Shared by prover and verifier — both build the same PathQuery via the path-query helpers on this struct, so the prover and the verifier can’t drift on shape. Parallels count’s DriveDocumentCountQuery.

Fields§

§document_type: DocumentTypeRef<'a>

The document type whose sum tree we’re querying.

§contract_id: [u8; 32]

The data contract id (separated from document_type so the verifier-side construction doesn’t need the full contract).

§document_type_name: String

The document type name (used to construct the index path).

§index: &'a Index

The covering index. Either the index whose summable flag matches the request’s sum_property (point lookup / aggregate case), or the index whose range_summable matches (range case). The doctype-primary-key fast path stores this as a sentinel — see path_query.rs’s primary_key_sum_path_query.

§where_clauses: Vec<WhereClause>

The structured where clauses.

§sum_property: String

The sum target property. Validated against the index’s summable and the doctype’s documents_summable at dispatch time.

Implementations§

Source§

impl<'a> DriveDocumentSumQuery<'a>

Source

pub fn primary_key_sum_path_query( contract_id: [u8; 32], document_type_name: &str, ) -> PathQuery

Build the PathQuery for the primary-key SumTree fast path (used when documents_summable is set and the query has no where clauses).

Mirrors count’s primary_key_count_tree_path_query signature — takes the two scalar arguments (contract_id, document_type_name) that are the only fields actually used.

Source

pub fn point_lookup_sum_path_query( &self, platform_version: &PlatformVersion, ) -> Result<PathQuery, Error>

Instance-method form of Self::point_lookup_sum_path_query_static — uses self.index (already resolved by the picker) rather than re-picking from the document type. Mirrors count’s point_lookup_count_path_query shape.

Source

pub fn aggregate_sum_path_query( &self, platform_version: &PlatformVersion, ) -> Result<PathQuery, Error>

Instance-method form: builds the AggregateSumOnRange path query against self.index (resolved upstream by the find_range_summable_index_for_where_clauses picker). The terminator’s range clause is required; prefix properties must use ==.

Source

pub fn aggregate_count_and_sum_path_query( &self, platform_version: &PlatformVersion, ) -> Result<PathQuery, Error>

Instance-method form: builds the combined PCPS AggregateCountAndSumOnRange path query against self.index. Requires the index to declare BOTH rangeCountable: true AND rangeSummable: true.

Source

pub fn distinct_sum_path_query( &self, limit: Option<u16>, left_to_right: bool, platform_version: &PlatformVersion, ) -> Result<PathQuery, Error>

Build the grovedb PathQuery for a per-distinct-key range-sum proof / no-proof walk against this query’s rangeSummable index. Sum analog of count’s distinct_count_path_query — the path-query shape is structurally identical (range on the terminator + outer Keys per In value on a prefix prop, if any). The only difference is at proof-emission time: the terminator’s value tree is a SumTree (vs CountTree on the count side), so grovedb emits KVSum ops instead of KVCount. The path-query bytes the prover and verifier reconstruct are the same on both sides.

left_to_right flips both the outer Query (when there’s an In on prefix) and the subquery direction so the iteration walks (in_key, terminator_key) tuples in the requested order — descending on left_to_right = false walks the In dimension lex-descending too, not just the inner range.

Errors:

  • No range where-clause / multiple range where-clauses
  • Multiple In clauses on prefix props
  • Non-Equal-non-In operator on a prefix prop
  • Missing prefix clause
Source

pub fn carrier_aggregate_sum_path_query( &self, limit: Option<u16>, left_to_right: bool, platform_version: &PlatformVersion, ) -> Result<PathQuery, Error>

Build the grovedb PathQuery for a carrier AggregateSumOnRange proof — one outer Key per In value (or one outer QueryItem per outer-range match), each terminating in an ASOR boundary walk over the per-branch range subtree. Returns one (in_key, i64) pair per resolved In branch via [grovedb::GroveDb::query_aggregate_sum_per_key] (no-proof) and [grovedb::GroveDb::verify_aggregate_sum_query_per_key] (verify), once those primitives ship.

Required where-clause shape (validated upstream by [crate::query::drive_document_sum_query::drive_dispatcher::detect_sum_mode] routing to [DocumentSumMode::RangeAggregateCarrierProof]):

  • Exactly one In clause on the In-property
  • Exactly one range clause on the terminator property of a rangeSummable: true index whose first property is the In-property
  • Any prefix properties between In and range must use == (mirror of Self::aggregate_sum_path_query’s non-In prefix rule)

Path-query structure (mirror of count’s analog — [crate::query::drive_document_count_query::path_query::DriveDocumentCountQuery::carrier_aggregate_count_path_query]):

  • Outer path stops one level above the In-bearing property subtree’s children (@/doc_prefix/0x01/doctype/<In-prop>).
  • Outer Query: Key(in_value_0), Key(in_value_1), … in lex-asc serialized order (grovedb’s multi-key walker invariant — required for prove/verify byte-parity).
  • subquery_path: the terminator property name (and any trailing == clause names between In and range, in index order).
  • subquery: Query::new_aggregate_sum_on_range(range_item).

Both the executor and the verifier consume the PathQuery this builder produces. Grovedb PR #670 (head e98bab5f) landed carrier-AggregateSumOnRange support (Query::validate_carrier_aggregate_sum_on_range and GroveDb::verify_aggregate_sum_query_per_key), so the builder’s output flows directly through prove_query and the verifier on both sides.

Errors:

  • No range where-clause / multiple range where-clauses → InvalidWhereClauseComponents
  • No In where-clause → InvalidWhereClauseComponents
  • In on a non-prefix property → InvalidWhereClauseComponents
  • Prefix property between In and range uses non-Equal → InvalidWhereClauseComponents
Source

pub fn carrier_aggregate_count_and_sum_path_query( &self, limit: Option<u16>, left_to_right: bool, platform_version: &PlatformVersion, ) -> Result<PathQuery, Error>

Combined PCPS (ProvableCountProvableSumTree) carrier variant: outer In or outer range, inner range carrying both per-bucket count AND per-bucket sum via grovedb’s AggregateCountAndSumOnRange primitive. The terminator property’s value tree must be PCPS (the index must declare BOTH rangeCountable: true AND rangeSummable: true).

PCPS-only — ProvableSumTree / ProvableCountTree / ProvableCountSumTree (the per-axis or root-only sum variants) reject the query item at the prover. Returns one (outer_key, u64 count, i64 sum) triple per resolved In branch. Verified client-side via GroveDb::verify_aggregate_count_and_sum_query_per_key (grovedb develop (PR #670 merged; head e98bab5f as of this PR)).

Same outer/subquery topology as Self::carrier_aggregate_sum_path_query — the only difference is the inner aggregation primitive (Query::new_aggregate_count_and_sum_on_range vs. Query::new_aggregate_sum_on_range) and the additional PCPS gate.

Source§

impl<'a> DriveDocumentSumQuery<'a>

Source

pub fn point_lookup_sum_path_query_static( contract: &DataContract, document_type: DocumentTypeRef<'_>, sum_property: &str, where_clauses: &[WhereClause], platform_version: &PlatformVersion, ) -> Result<PathQuery, Error>

Static wrapper for the bench / verifier-side rebuild. Calls the instance method via a temporary DriveDocumentSumQuery built from the picked covering index.

Source

pub fn aggregate_sum_path_query_static( contract: &DataContract, document_type: DocumentTypeRef<'_>, sum_property: &str, where_clauses: &[WhereClause], platform_version: &PlatformVersion, ) -> Result<PathQuery, Error>

Static wrapper for the bench / verifier-side rebuild — picks the covering range-summable index and delegates to the instance method.

Source

pub fn carrier_aggregate_sum_path_query_static( contract: &DataContract, document_type: DocumentTypeRef<'_>, sum_property: &str, where_clauses: &[WhereClause], limit: Option<u16>, left_to_right: bool, platform_version: &PlatformVersion, ) -> Result<PathQuery, Error>

Static wrapper for the bench / verifier-side rebuild — picks the covering range-summable index and delegates to the carrier instance method. Mirror of count’s analog [crate::query::drive_document_count_query::path_query::DriveDocumentCountQuery::carrier_aggregate_count_path_query]’s implicit static surface via the executor. Used by the SDK verifier-side rebuild via GroveDb::verify_aggregate_sum_query_per_key (grovedb PR #670 head e98bab5f).

Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn execute_no_proof( &self, drive: &Drive, transaction: TransactionArg<'_, '_>, platform_version: &PlatformVersion, ) -> Result<Vec<SumEntry>, Error>

Executes the sum query without generating a proof.

Returns the total sum as a single SumEntry with empty key (the unified-sum Total shape).

Mirror of count’s execute_no_proof — runs through the same Self::point_lookup_sum_path_query builder the prove path uses, then runs grove.query to fetch the matched SumTree elements and sums their sum_value_or_default().

Source

pub fn execute_point_lookup_sum_with_proof( &self, drive: &Drive, transaction: TransactionArg<'_, '_>, platform_version: &PlatformVersion, ) -> Result<Vec<u8>, Error>

Generates a grovedb proof of the SumTree elements covering a fully-covered Equal/In sum query against a summable: "<x>" index. Mirrors count’s execute_point_lookup_count_with_proof.

Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn execute_range_sum_no_proof( &self, drive: &Drive, options: &RangeSumOptions, transaction: TransactionArg<'_, '_>, platform_version: &PlatformVersion, ) -> Result<Vec<SumEntry>, Error>

Range-aware sum walk against a rangeSummable: true index.

Mirror of count’s execute_range_count_no_proof. Routing:

  • Flat summed (no In, distinct=false): single query_aggregate_sum call against the merk-level AggregateSumOnRange primitive. O(log n).
  • Compound summed (In on prefix, distinct=false): per-In fan-out — one query_aggregate_sum call per matched In branch, summed in Rust.
  • Distinct mode (distinct=true): walks the unified distinct_sum_path_query and emits one entry per matched (in_key, key) pair. (Currently stubbed pending the distinct-builder port.)
Source

pub fn execute_aggregate_sum_with_proof( &self, drive: &Drive, transaction: TransactionArg<'_, '_>, platform_version: &PlatformVersion, ) -> Result<Vec<u8>, Error>

Generates a grovedb AggregateSumOnRange proof for a range-sum query against a rangeSummable index. Returned proof bytes verify via GroveDb::verify_aggregate_sum_query yielding (root_hash, i64 sum).

Source

pub fn execute_distinct_sum_with_proof( &self, drive: &Drive, limit: u16, left_to_right: bool, transaction: TransactionArg<'_, '_>, platform_version: &PlatformVersion, ) -> Result<Vec<u8>, Error>

Per-distinct-key range-sum proof against this query’s rangeSummable index. Mirror of count’s execute_distinct_count_with_proof. Currently routes through distinct_sum_path_query which is stubbed (pending the ~280-line port from count); calls before that lands surface Unsupported cleanly.

Source

pub fn execute_aggregate_count_and_sum_with_proof( &self, drive: &Drive, transaction: TransactionArg<'_, '_>, platform_version: &PlatformVersion, ) -> Result<Vec<u8>, Error>

Generates a grovedb leaf-PCPS AggregateCountAndSumOnRange proof for a combined count + sum range query against an index that declares BOTH rangeCountable: true AND rangeSummable: true. Returned proof bytes verify via GroveDb::verify_aggregate_count_and_sum_query yielding (root_hash, u64 count, i64 sum) — the load-bearing primitive for the [average-index-examples chapter] (../../../../book/src/drive/average-index-examples.md)’s Query 5 (“Class Trend”). PCPS-only: the terminator’s value tree MUST be a ProvableCountProvableSumTree; lighter (CountSumTree / ProvableCountSumTree / ProvableSumTree) terminators are rejected at the grovedb merk-gate.

Leaf analog of Self::execute_carrier_aggregate_count_and_sum_with_proof: same primitive, no outer In fan-out — single (count, sum) per proof rather than per-In-key (count, sum) triples.

Source

pub fn execute_carrier_aggregate_sum_with_proof( &self, drive: &Drive, limit: Option<u16>, left_to_right: bool, transaction: TransactionArg<'_, '_>, platform_version: &PlatformVersion, ) -> Result<Vec<u8>, Error>

Generates a grovedb carrier AggregateSumOnRange proof for In + range queries with group_by = [in_field] (and the RangeAggregateCarrierProof mode in general). Sum analog of count’s crate::query::drive_document_count_query::DriveDocumentCountQuery::execute_carrier_aggregate_count_with_proof.

Builds the carrier PathQuery via Self::carrier_aggregate_sum_path_query and asks grovedb for a proof. The proof commits one aggregate sum per resolved In branch; verified client-side via GroveDb::verify_aggregate_sum_query_per_key (grovedb PR #670 head e98bab5f), which returns (RootHash, Vec<(Vec<u8>, i64)>).

left_to_right and limit are byte-load-bearing — they are part of the PathQuery bytes the verifier rebuilds. See count’s analog for the rationale.

Source

pub fn execute_carrier_aggregate_count_and_sum_with_proof( &self, drive: &Drive, limit: Option<u16>, left_to_right: bool, transaction: TransactionArg<'_, '_>, platform_version: &PlatformVersion, ) -> Result<Vec<u8>, Error>

Combined PCPS carrier proof: AggregateCountAndSumOnRange-on-carrier. Sum-and-count analog of Self::execute_carrier_aggregate_sum_with_proof. Requires the chosen index to declare BOTH rangeCountable: true AND rangeSummable: true so the terminator’s value tree is a ProvableCountProvableSumTree.

Returns proof bytes the verifier maps to Vec<(Vec<u8>, u64, i64)> via GroveDb::verify_aggregate_count_and_sum_query_per_key (grovedb PR #670 head e98bab5f) — one (in_key, count, sum) triple per resolved In branch.

Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn verify_aggregate_sum_proof( &self, proof: &[u8], platform_version: &PlatformVersion, ) -> Result<(RootHash, i64), Error>

Verifies a grovedb AggregateSumOnRange proof (grovedb PR #670) and returns (root_hash, i64 sum). Counterpart to the prover-side Self::execute_aggregate_sum_with_proof. Calls GroveDb::verify_aggregate_sum_query.

Tree-type restriction: the chosen index must declare rangeSummable: true so the terminator’s value tree is at least a ProvableSumTree; the grovedb merk gate rejects lighter sum-bearing variants on the aggregate primitive. Same path-query byte-equality contract as every other paired prover/verifier in this surface — both sides share Self::aggregate_sum_path_query.

Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn verify_carrier_aggregate_sum_proof( &self, proof: &[u8], limit: Option<u16>, left_to_right: bool, platform_version: &PlatformVersion, ) -> Result<(RootHash, Vec<(Vec<u8>, i64)>), Error>

Verifies a carrier AggregateSumOnRange proof and returns (root_hash, per_key_sums) — one (in_key, i64) pair per resolved In branch. Order depends on left_to_right: true returns serialized lex-ascending, false returns serialized lex-descending.

Sum-side analog of count’s crate::query::DriveDocumentCountQuery::verify_carrier_aggregate_count_proof. Counterpart to the prover-side execute_carrier_aggregate_sum_with_proof: rebuilds the same PathQuery via carrier_aggregate_sum_path_query and calls [grovedb::GroveDb::verify_aggregate_sum_query_per_key] (once the grovedb sister PR exposes it). The caller is responsible for combining the returned root_hash with the surrounding tenderdash signature — see rs-drive-proof-verifier’s wrapper for the canonical composition.

§Arguments
  • proof — raw grovedb proof bytes.
  • limit — per-branch carrier walk cap; must match the prover’s SizedQuery::limit.
  • left_to_right — proof-shaping bit. Must match the value the prover passed to Self::execute_carrier_aggregate_sum_with_proof. Mismatch produces different PathQuery bytes and the tenderdash root check fails.
  • platform_version — selects the method version.
Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn verify_carrier_aggregate_count_and_sum_proof( &self, proof: &[u8], limit: Option<u16>, left_to_right: bool, platform_version: &PlatformVersion, ) -> Result<(RootHash, Vec<(Vec<u8>, u64, i64)>), Error>

Verifies a combined PCPS carrier proof (AggregateCountAndSumOnRange on a carrier subquery) and returns (root_hash, per_key_count_sums) — one (in_key, u64 count, i64 sum) triple per resolved In branch.

Combined-axis analog of Self::verify_carrier_aggregate_sum_proof. Requires the covering index to declare BOTH rangeCountable: true AND rangeSummable: true so the terminator’s value tree is a ProvableCountProvableSumTree. Counterpart to the prover-side execute_carrier_aggregate_count_and_sum_with_proof. Calls GroveDb::verify_aggregate_count_and_sum_query_per_key (grovedb develop (PR #670 merged; head e98bab5f as of this PR)).

Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn verify_aggregate_count_and_sum_proof( &self, proof: &[u8], platform_version: &PlatformVersion, ) -> Result<(RootHash, u64, i64), Error>

Verifies a leaf-PCPS AggregateCountAndSumOnRange proof and returns (root_hash, count, sum) — the verified (count, sum) pair extracted from one merk traversal of the PCPS terminator. Counterpart to the prover-side execute_aggregate_count_and_sum_with_proof. Calls GroveDb::verify_aggregate_count_and_sum_query (grovedb PR #670 head e98bab5f).

The client computes avg = sum as f64 / count as f64 (or preferred precision) to recover the verified average — the proof commits both metrics from the same in-range set, so there’s no way for the server to splice a count from one set with a sum from another. This is the load-bearing primitive for the [average-index-examples chapter] (../../../../book/src/drive/average-index-examples.md)’s Query 5.

Tree-type restriction: the chosen index must declare BOTH rangeCountable: true AND rangeSummable: true so the terminator’s value tree is a ProvableCountProvableSumTree (PCPS). Lighter sum-bearing or count-bearing variants reject the combined primitive at the merk gate.

Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn verify_primary_key_sum_tree_proof( proof: &[u8], contract_id: [u8; 32], document_type_name: &str, platform_version: &PlatformVersion, ) -> Result<(RootHash, i64), Error>

Verifies a grovedb proof of the document type’s primary-key SumTree element and returns the unfiltered total sum. Sum analog of count’s verify_primary_key_count_tree_proof.

Used by the prove path’s documentsSummable: "<prop>" fast path — when the where clauses are empty and the document type has a matching documents_summable, the executor proves the primary-key SumTree element directly via Self::primary_key_sum_path_query (a single-key verify_query shape), avoiding the per-index covering walk.

Returns 0 when the element is absent (the proof’s element stream is empty or carries None). At contract apply time the SumTree element is created unconditionally for documents_summable doctypes, so absence here means “no documents inserted yet”, not a misconfiguration.

Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn verify_primary_key_count_sum_tree_proof( proof: &[u8], contract_id: [u8; 32], document_type_name: &str, platform_version: &PlatformVersion, ) -> Result<(RootHash, u64, i64), Error>

Verifies a grovedb proof of the document type’s primary-key CountSumTree (or ProvableCountSumTree / ProvableCountProvableSumTree) element and returns the unfiltered (count, sum) pair. Average-aggregate analog of Self::verify_primary_key_sum_tree_proof / count’s verify_primary_key_count_tree_proof.

Used by the prove path’s AVG fast path — when the where clauses are empty and the document type has both documentsCountable: true and documentsSummable: "<prop>" (which implies the primary key tree is one of the count-sum-bearing variants), the executor proves the primary-key element directly via Self::primary_key_sum_path_query — same single-key shape as the SumTree fast path, just decoded as a combined (count, sum) instead of i64 alone.

Returns (0, 0) when the element is absent.

Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn verify_point_lookup_sum_proof( &self, proof: &[u8], platform_version: &PlatformVersion, ) -> Result<(RootHash, Vec<SumEntry>), Error>

Verifies a grovedb point-lookup sum proof and returns the per-branch entries. Sum analog of count’s verify_point_lookup_count_proof.

Single-terminator shape, kept in sync with Self::point_lookup_sum_path_query: the insertion side stores every summable: "<prop>" index’s terminator value tree as a SumTree (with sibling continuations NonCounted-wrapped so they don’t pollute the parent’s sum), so proofs target the value tree directly via Key(serialized_value) and sum_value_or_default() on the verified element is the per-branch sum.

§Entry shape

One entry per present queried key. Today’s path query does not set absence_proofs_for_non_existing_searched_keys: true, so absent In values are silently omitted from the elements stream. Callers that need to distinguish “verified with sum N” from “queried but absent” diff their request’s In array against the returned entries by key.

The Option<i64> field’s None variant is reserved for a future variant that flips absence_proofs_for_non_existing_searched_keys; the current path query won’t produce it.

Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn verify_distinct_sum_proof( &self, proof: &[u8], limit: u16, left_to_right: bool, platform_version: &PlatformVersion, ) -> Result<(RootHash, Vec<SumEntry>), Error>

Verifies a regular grovedb range proof against a rangeSummable: true index’s terminator SumTrees and returns the per-(in_key, terminator_key) sums. Sum analog of count’s verify_distinct_count_proof.

Used by the prove path’s [DocumentSumMode::RangeDistinctProof] (GroupByRange / GroupByCompound + range + prove). Rebuilds the same PathQuery the prover used via Self::distinct_sum_path_query (including limit and left_to_right — both are encoded into the path query bytes) and walks the verified (path, key, Option<Element>) triples to extract sum_value_or_default() from each terminator SumTree.

Cross-fork aggregation is intentionally NOT done here — callers reduce by key client-side if they want a flat histogram. See SumEntry’s sibling crate::query::SplitCountEntry for the no-merge rationale (identical contract on the sum side).

Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn verify_point_lookup_count_and_sum_proof( &self, proof: &[u8], platform_version: &PlatformVersion, ) -> Result<(RootHash, Vec<AverageEntry>), Error>

Verifies a grovedb point-lookup proof against an index whose terminator value tree is a count-sum-bearing variant (CountSumTree / ProvableCountSumTree / ProvableCountProvableSumTree) and returns per-branch (count, sum) entries. AVG analog of Self::verify_point_lookup_sum_proof.

Walks the verified (path, key, Option<Element>) triples emitted by Self::point_lookup_sum_path_query and extracts count_sum_value_or_default() from each present terminator element — (count, sum) come from the same merk hash so there’s no way for the server to splice a count from one branch with a sum from another.

Today’s path query does not set absence_proofs_for_non_existing_searched_keys: true, so absent In values are silently omitted from the result. Callers that need to distinguish “verified with (c, s)” from “queried but absent” diff their In array against the returned entries by key.

Source§

impl DriveDocumentSumQuery<'_>

Source

pub fn verify_distinct_count_and_sum_proof( &self, proof: &[u8], limit: u16, left_to_right: bool, platform_version: &PlatformVersion, ) -> Result<(RootHash, Vec<AverageEntry>), Error>

Verifies a per-distinct-key range-AVG proof against an index whose terminator value trees are count-sum-bearing variants (the chosen index opts into BOTH rangeCountable: true AND rangeSummable: true, i.e. a rangeAverageable: true index). Average analog of Self::verify_distinct_sum_proof / count’s verify_distinct_count_proof.

Rebuilds the same PathQuery the prover used via Self::distinct_sum_path_query (the count + sum sides share the same path-query shape — the difference is at proof-emission time which merk ops are emitted) and walks the verified (path, key, Option<Element>) triples to extract count_sum_value_or_default() from each present terminator element.

Trait Implementations§

Source§

impl<'a> Clone for DriveDocumentSumQuery<'a>

Source§

fn clone(&self) -> DriveDocumentSumQuery<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for DriveDocumentSumQuery<'a>

Source§

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

Formats the value using the given formatter. Read more

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
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> CostsExt for T

§

fn wrap_with_cost(self, cost: OperationCost) -> CostContext<Self>
where Self: Sized,

Wraps any value into a CostContext object with provided costs.
§

fn wrap_fn_cost( self, f: impl FnOnce(&Self) -> OperationCost, ) -> CostContext<Self>
where Self: Sized,

Wraps any value into CostContext object with costs computed using the value getting wrapped.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T, U> IntoOnNetwork<U> for T
where U: FromOnNetwork<T>,

§

fn into_on_network(self, network: Network) -> U

Calls U::from_on_network(self).

Source§

impl<T, U> IntoPlatformVersioned<U> for T

Source§

fn into_platform_versioned(self, platform_version: &PlatformVersion) -> U

Performs the conversion.
§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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

§

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

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

fn try_from_versioned( value: U, _grove_version: &GroveVersion, ) -> Result<T, <T as TryFromVersioned<U>>::Error>

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.
Source§

impl<T, U> TryIntoPlatformVersioned<U> for T

Source§

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

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

fn try_into_platform_versioned( self, platform_version: &PlatformVersion, ) -> Result<U, <U as TryFromPlatformVersioned<T>>::Error>

Performs the conversion.
§

impl<T, U> TryIntoVersioned<U> for T
where U: TryFromVersioned<T>,

§

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

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

fn try_into_versioned( self, grove_version: &GroveVersion, ) -> Result<U, <U as TryFromVersioned<T>>::Error>

Performs the conversion.
§

impl<T, U> TryIntoWithBlockHashLookup<U> for T
where U: TryFromWithBlockHashLookup<T>,

§

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

§

fn try_into_with_block_hash_lookup<F>( self, block_hash_lookup: F, network: Network, ) -> Result<U, <T as TryIntoWithBlockHashLookup<U>>::Error>
where F: Fn(&BlockHash) -> Option<u32>,

Converts self into T, using a block hash lookup function.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more