pub struct Client { /* private fields */ }
Implementations§
Source§impl Client
impl Client
Sourcepub async fn create_parquet_folder(
&self,
query: Query,
config: ParquetConfig,
) -> Result<()>
pub async fn create_parquet_folder( &self, query: Query, config: ParquetConfig, ) -> Result<()>
Create a parquet file by executing a query.
Path should point to a folder that will contain the parquet files in the end.
Sourcepub async fn get_height(&self) -> Result<u64>
pub async fn get_height(&self) -> Result<u64>
Get the height of the source hypersync instance
Sourcepub async fn get_height_with_retry(&self) -> Result<u64>
pub async fn get_height_with_retry(&self) -> Result<u64>
Get the height of the source hypersync instance Internally calls get_height. On an error from the source hypersync instance, sleeps for 1 second (increasing by 1 each failure up to max of 5 seconds) and retries query until success.
pub async fn stream<Format: TransportFormat>( &self, query: Query, config: StreamConfig, ) -> Result<Receiver<Result<QueryResponse>>>
Sourcepub async fn send<Format: TransportFormat>(
&self,
query: &Query,
) -> Result<QueryResponse>
pub async fn send<Format: TransportFormat>( &self, query: &Query, ) -> Result<QueryResponse>
Send a query request to the source hypersync instance.
Returns a query response which contains block, tx and log data. Format can be ArrowIpc or Parquet.
Sourcepub async fn send_with_retry<Format: TransportFormat>(
&self,
query: &Query,
) -> Result<QueryResponse>
pub async fn send_with_retry<Format: TransportFormat>( &self, query: &Query, ) -> Result<QueryResponse>
Send a query request to the source hypersync instance. Internally calls send. On an error from the source hypersync instance, sleeps for 1 second (increasing by 1 each failure up to max of 5 seconds) and retries query until success.
Returns a query response which contains block, tx and log data. Format can be ArrowIpc or Parquet.
Sourcepub fn preset_query_blocks_and_transactions(
from_block: u64,
to_block: Option<u64>,
) -> Query
pub fn preset_query_blocks_and_transactions( from_block: u64, to_block: Option<u64>, ) -> Query
Returns a query for all Blocks and Transactions within the block range (from_block, to_block]
If to_block is None then query runs to the head of the chain.
Note: this is only for quickstart purposes. For the best performance, create a custom query
that only includes the fields you’ll use in field_selection
.
Sourcepub fn preset_query_blocks_and_transaction_hashes(
from_block: u64,
to_block: Option<u64>,
) -> Query
pub fn preset_query_blocks_and_transaction_hashes( from_block: u64, to_block: Option<u64>, ) -> Query
Returns a query object for all Blocks and hashes of the Transactions within the block range
(from_block, to_block]. Also returns the block_hash and block_number fields on each Transaction
so it can be mapped to a block. If to_block is None then query runs to the head of the chain.
Note: this is only for quickstart purposes. For the best performance, create a custom query
that only includes the fields you’ll use in field_selection
.
Sourcepub fn preset_query_logs<A>(
from_block: u64,
to_block: Option<u64>,
address: A,
) -> Result<Query>
pub fn preset_query_logs<A>( from_block: u64, to_block: Option<u64>, address: A, ) -> Result<Query>
Returns a query object for all Logs within the block range (from_block, to_block] from
the given address. If to_block is None then query runs to the head of the chain.
Note: this is only for quickstart purposes. For the best performance, create a custom query
that only includes the fields you’ll use in field_selection
.
Sourcepub fn preset_query_logs_of_event<A, T>(
from_block: u64,
to_block: Option<u64>,
topic0: T,
address: A,
) -> Result<Query>
pub fn preset_query_logs_of_event<A, T>( from_block: u64, to_block: Option<u64>, topic0: T, address: A, ) -> Result<Query>
Returns a query for all Logs within the block range (from_block, to_block] from the
given address with a matching topic0 event signature. Topic0 is the keccak256 hash
of the event signature. If to_block is None then query runs to the head of the chain.
Note: this is only for quickstart purposes. For the best performance, create a custom query
that only includes the fields you’ll use in field_selection
.
Sourcepub fn preset_query_transactions(
from_block: u64,
to_block: Option<u64>,
) -> Query
pub fn preset_query_transactions( from_block: u64, to_block: Option<u64>, ) -> Query
Returns a query object for all transactions within the block range (from_block, to_block].
If to_block is None then query runs to the head of the chain.
Note: this is only for quickstart purposes. For the best performance, create a custom query
that only includes the fields you’ll use in field_selection
.
Sourcepub fn preset_query_transactions_from_address<A>(
from_block: u64,
to_block: Option<u64>,
address: A,
) -> Result<Query>
pub fn preset_query_transactions_from_address<A>( from_block: u64, to_block: Option<u64>, address: A, ) -> Result<Query>
Returns a query object for all transactions from an address within the block range
(from_block, to_block]. If to_block is None then query runs to the head of the chain.
Note: this is only for quickstart purposes. For the best performance, create a custom query
that only includes the fields you’ll use in field_selection
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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