Struct Query

Source
pub struct Query {
Show 13 fields pub from_block: u64, pub to_block: Option<u64>, pub logs: Vec<LogSelection>, pub transactions: Vec<TransactionSelection>, pub traces: Vec<TraceSelection>, pub blocks: Vec<BlockSelection>, pub include_all_blocks: bool, pub field_selection: FieldSelection, pub max_num_blocks: Option<usize>, pub max_num_transactions: Option<usize>, pub max_num_logs: Option<usize>, pub max_num_traces: Option<usize>, pub join_mode: JoinMode,
}

Fields§

§from_block: u64

The block to start the query from

§to_block: Option<u64>

The block to end the query at. If not specified, the query will go until the end of data. Exclusive, the returned range will be [from_block..to_block).

The query will return before it reaches this target block if it hits the time limit configured on the server. The user should continue their query by putting the next_block field in the response into from_block field of their next query. This implements pagination.

§logs: Vec<LogSelection>

List of log selections, these have an OR relationship between them, so the query will return logs that match any of these selections.

§transactions: Vec<TransactionSelection>

List of transaction selections, the query will return transactions that match any of these selections

§traces: Vec<TraceSelection>

List of trace selections, the query will return traces that match any of these selections

§blocks: Vec<BlockSelection>

List of block selections, the query will return blocks that match any of these selections

§include_all_blocks: bool

Weather to include all blocks regardless of if they are related to a returned transaction or log. Normally the server will return only the blocks that are related to the transaction or logs in the response. But if this is set to true, the server will return data for all blocks in the requested range [from_block, to_block).

§field_selection: FieldSelection

Field selection. The user can select which fields they are interested in, requesting less fields will improve query execution time and reduce the payload size so the user should always use a minimal number of fields.

§max_num_blocks: Option<usize>

Maximum number of blocks that should be returned, the server might return more blocks than this number but it won’t overshoot by too much.

§max_num_transactions: Option<usize>

Maximum number of transactions that should be returned, the server might return more transactions than this number but it won’t overshoot by too much.

§max_num_logs: Option<usize>

Maximum number of logs that should be returned, the server might return more logs than this number but it won’t overshoot by too much.

§max_num_traces: Option<usize>

Maximum number of traces that should be returned, the server might return more traces than this number but it won’t overshoot by too much.

§join_mode: JoinMode

Selects join mode for the query, Default: join in this order logs -> transactions -> traces -> blocks JoinAll: join everything to everything. For example if logSelection matches log0, we get the associated transaction of log0 and then we get associated logs of that transaction as well. Applites similarly to blocks, traces. JoinNothing: join nothing.

Trait Implementations§

Source§

impl Clone for Query

Source§

fn clone(&self) -> Query

Returns a copy 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 Debug for Query

Source§

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

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

impl Default for Query

Source§

fn default() -> Query

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

impl<'de> Deserialize<'de> for Query

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Query

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Query

§

impl !RefUnwindSafe for Query

§

impl Send for Query

§

impl Sync for Query

§

impl Unpin for Query

§

impl !UnwindSafe for Query

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 = 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.
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,