Struct hyperfuel_client::Client
source · pub struct Client { /* private fields */ }Implementations§
source§impl Client
impl Client
sourcepub async fn create_parquet_folder(
&self,
query: Query,
path: String
) -> Result<()>
pub async fn create_parquet_folder( &self, query: Query, path: String ) -> Result<()>
Create a parquet file by executing a query.
If the query can’t be finished in a single request, this function will keep on making requests using the pagination mechanism (next_block) until it reaches the end. It will stream data into the parquet file as it comes from the server.
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.
sourcepub async fn get_data(&self, query: &Query) -> Result<QueryResponseTyped>
pub async fn get_data(&self, query: &Query) -> Result<QueryResponseTyped>
Send a query request to the source hypersync instance.
Returns a query response which contains typed data.
NOTE: this query returns loads all transactions that your match your receipt, input, or output selections and applies the field selection to all these loaded transactions. So your query will return the data you want plus additional data from the loaded transactions. This functionality is in case you want to associate receipts, inputs, or outputs with eachother.
sourcepub async fn get_selected_data(
&self,
query: &Query
) -> Result<QueryResponseTyped>
pub async fn get_selected_data( &self, query: &Query ) -> Result<QueryResponseTyped>
Send a query request to the source hypersync instance.
Returns a query response that which contains structured data that doesn’t include any inputs, outputs, and receipts that don’t exactly match the query’s input, outout, or receipt selection.
sourcepub async fn preset_query_get_logs<H: Into<Hash>>(
&self,
emitting_contracts: Vec<H>,
from_block: u64,
to_block: Option<u64>
) -> Result<LogResponse>
pub async fn preset_query_get_logs<H: Into<Hash>>( &self, emitting_contracts: Vec<H>, from_block: u64, to_block: Option<u64> ) -> Result<LogResponse>
Send a query request to the source hypersync instance.
Returns all log and logdata receipts of logs emitted by any of the specified contracts within the block range. If no ‘to_block’ is specified, query will run to the head of the chain. Returned data contains all the data needed to decode Fuel Log or LogData receipts as well as some extra data for context. This query doesn’t return any logs that were a part of a failed transaction.
NOTE: this function is experimental and might be removed in future versions.
sourcepub async fn get_arrow_data(&self, query: &Query) -> Result<QueryResponse>
pub async fn get_arrow_data(&self, query: &Query) -> Result<QueryResponse>
Send a query request to the source hypersync instance.
Returns a query response which contains arrow data.
NOTE: this query returns loads all transactions that your match your receipt, input, or output selections and applies the field selection to all these loaded transactions. So your query will return the data you want plus additional data from the loaded transactions. This functionality is in case you want to associate receipts, inputs, or outputs with eachother.
sourcepub async fn get_arrow_data_with_retry(
&self,
query: &Query
) -> Result<QueryResponse>
pub async fn get_arrow_data_with_retry( &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 arrow data.
NOTE: this query returns loads all transactions that your match your receipt, input, or output selections and applies the field selection to all these loaded transactions. So your query will return the data you want plus additional data from the loaded transactions. This functionality is in case you want to associate receipts, inputs, or outputs with eachother. Format can be ArrowIpc.
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> 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