pub enum ChainQueryFilterRange {
    Unbounded,
    ActionSeqRange(u32u32),
    ActionHashRange(HoloHash<Action>, HoloHash<Action>),
    ActionHashTerminated(HoloHash<Action>, u32),
}
Expand description

Defines several ways that queries can be restricted to a range. Notably hash bounded ranges disambiguate forks whereas sequence indexes do not as the same position can be found in many forks. The reason that this does NOT use native rust range traits is that the hash bounded queries MUST be inclusive otherwise the integrity and fork disambiguation logic is impossible. An exclusive range bound that does not include the final action tells us nothing about which fork to select between N forks of equal length that proceed it. With an inclusive hash bounded range the final action always points unambiguously at the “correct” fork that the range is over. Start hashes are not needed to provide this property so ranges can be hash terminated with a length of preceeding records to return only. Technically the seq bounded ranges do not imply any fork disambiguation and so could be a range but for simplicity we left the API symmetrical in boundedness across all enum variants. @TODO It may be possible to provide/implement RangeBounds in the case that a full sequence of records/actions is provided but it would need to be handled as inclusive first, to enforce the integrity of the query, then the exclusiveness achieved by simply removing the final record after the fact.

Variants

Unbounded

Do NOT apply any range filtering for this query.

ActionSeqRange(u32u32)

A range over source chain sequence numbers. This is ambiguous over forking histories and so should NOT be used in validation logic. Inclusive start, inclusive end.

ActionHashRange(HoloHash<Action>, HoloHash<Action>)

A range over source chain action hashes. This CAN be used in validation logic as forks are disambiguated. Inclusive start and end (unlike std::ops::Range).

ActionHashTerminated(HoloHash<Action>, u32)

The terminating action hash and N preceeding records. N = 0 returns only the record with this ActionHash. This CAN be used in validation logic as forks are not possible when “looking up” towards genesis from some ActionHash.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserializes using the given deserializer

Returns the argument unchanged.

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

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The type for metadata in pointers and references to Self.

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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