pub struct Query<D>where
D: QueryExecute,{ /* private fields */ }
Expand description
A query that can be executed on the Hedera network.
Implementations§
source§impl Query<AccountBalanceQueryData>
impl Query<AccountBalanceQueryData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Get the account ID for which information is requested.
sourcepub fn account_id(&mut self, id: AccountId) -> &mut Self
pub fn account_id(&mut self, id: AccountId) -> &mut Self
Sets the account ID for which information is requested.
This is mutually exclusive with contract_id
.
sourcepub fn get_contract_id(&self) -> Option<ContractId>
pub fn get_contract_id(&self) -> Option<ContractId>
Get the contract ID for which information is requested.
sourcepub fn contract_id(&mut self, id: ContractId) -> &mut Self
pub fn contract_id(&mut self, id: ContractId) -> &mut Self
Sets the contract ID for which information is requested.
This is mutually exclusive with account_id
.
source§impl Query<AccountInfoQueryData>
impl Query<AccountInfoQueryData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Gets the account ID for which information is requested.
sourcepub fn account_id(&mut self, id: AccountId) -> &mut Self
pub fn account_id(&mut self, id: AccountId) -> &mut Self
Sets the account ID for which information is requested.
source§impl Query<AccountRecordsQueryData>
impl Query<AccountRecordsQueryData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Gets the account ID for which the records should be retrieved.
sourcepub fn account_id(&mut self, id: AccountId) -> &mut Self
pub fn account_id(&mut self, id: AccountId) -> &mut Self
Sets the account ID for which the records should be retrieved.
source§impl Query<AccountStakersQueryData>
impl Query<AccountStakersQueryData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Gets the account ID for which the records should be retrieved.
sourcepub fn account_id(&mut self, id: AccountId) -> &mut Self
pub fn account_id(&mut self, id: AccountId) -> &mut Self
Sets the account ID for which the records should be retrieved.
source§impl Query<ContractBytecodeQueryData>
impl Query<ContractBytecodeQueryData>
sourcepub fn get_contract_id(&self) -> Option<ContractId>
pub fn get_contract_id(&self) -> Option<ContractId>
Gets the contract for which information is requested.
sourcepub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self
pub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self
Sets the contract for which information is requested.
source§impl Query<ContractCallQueryData>
impl Query<ContractCallQueryData>
sourcepub fn get_contract_id(&self) -> Option<ContractId>
pub fn get_contract_id(&self) -> Option<ContractId>
Gets the contract instance to call.
sourcepub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self
pub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self
Sets the contract to make a static call against.
sourcepub fn get_contract_parameters(&self) -> &[u8] ⓘ
pub fn get_contract_parameters(&self) -> &[u8] ⓘ
Gets the function parameters as their raw bytes.
sourcepub fn function_parameters(&mut self, data: Vec<u8>) -> &mut Self
pub fn function_parameters(&mut self, data: Vec<u8>) -> &mut Self
Sets the function parameters as their raw bytes.
sourcepub fn function_with_parameters(
&mut self,
name: &str,
parameters: &ContractFunctionParameters
) -> &mut Self
pub fn function_with_parameters( &mut self, name: &str, parameters: &ContractFunctionParameters ) -> &mut Self
Sets the function with parameters.
sourcepub fn get_sender_account_id(&self) -> Option<AccountId>
pub fn get_sender_account_id(&self) -> Option<AccountId>
Gets the sender for this transaction.
sourcepub fn sender_account_id(&mut self, sender_account_id: AccountId) -> &mut Self
pub fn sender_account_id(&mut self, sender_account_id: AccountId) -> &mut Self
Sets the sender for this transaction.
source§impl Query<ContractInfoQueryData>
impl Query<ContractInfoQueryData>
sourcepub fn get_contract_id(&self) -> Option<ContractId>
pub fn get_contract_id(&self) -> Option<ContractId>
Returns the contract for which information is requested.
sourcepub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self
pub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self
Sets the contract for which information is requested.
source§impl<D> Query<D>where
D: QueryExecute,
impl<D> Query<D>where
D: QueryExecute,
sourcepub fn get_node_account_ids(&self) -> Option<&[AccountId]>
pub fn get_node_account_ids(&self) -> Option<&[AccountId]>
Returns the account IDs of the nodes that this query may be submitted to.
Defaults to the full list of nodes configured on the client; or, the node account IDs configured on the query payment transaction (if explicitly provided).
sourcepub fn node_account_ids(
&mut self,
ids: impl IntoIterator<Item = AccountId>
) -> &mut Self
pub fn node_account_ids( &mut self, ids: impl IntoIterator<Item = AccountId> ) -> &mut Self
Sets the account IDs of the nodes that this query may be submitted to.
Defaults to the full list of nodes configured on the client; or, the node account IDs configured on the query payment transaction (if explicitly provided).
sourcepub fn get_payment_amount(&self) -> Option<Hbar>
pub fn get_payment_amount(&self) -> Option<Hbar>
Returns the explicit payment amount for this query.
The client will submit exactly this amount for the payment of this query. Hedera will not return any remainder (over the actual cost for this query).
sourcepub fn payment_amount(&mut self, amount: Hbar) -> &mut Self
pub fn payment_amount(&mut self, amount: Hbar) -> &mut Self
Sets the explicit payment amount for this query.
The client will submit exactly this amount for the payment of this query. Hedera will not return any remainder (over the actual cost for this query).
sourcepub fn get_max_amount(&self) -> Option<Hbar>
pub fn get_max_amount(&self) -> Option<Hbar>
Returns the maximum payment allowable for this query.
sourcepub fn max_payment_amount(&mut self, max: impl Into<Option<Hbar>>) -> &mut Self
pub fn max_payment_amount(&mut self, max: impl Into<Option<Hbar>>) -> &mut Self
Sets the maximum payment allowable for this query.
When a query is executed without an explicit payment amount set, the client will first request the cost of the given query from the node it will be submitted to and attach a payment for that amount from the operator account on the client.
If the returned value is greater than this value, a MaxQueryPaymentExceeded
error
will be returned.
Defaults to the maximum payment amount configured on the client.
Sets to None
to allow unlimited payment amounts.
sourcepub fn get_payment_transaction_valid_duration(&self) -> Option<Duration>
pub fn get_payment_transaction_valid_duration(&self) -> Option<Duration>
Returns the duration that the payment transaction is valid for, once finalized and signed.
sourcepub fn payment_transaction_valid_duration(
&mut self,
duration: Duration
) -> &mut Self
pub fn payment_transaction_valid_duration( &mut self, duration: Duration ) -> &mut Self
Sets the duration that the payment transaction is valid for, once finalized and signed.
Defaults to 120 seconds (or two minutes).
sourcepub fn get_max_payment_transaction_fee(&self) -> Option<Hbar>
pub fn get_max_payment_transaction_fee(&self) -> Option<Hbar>
Returns the maximum transaction fee the payer account is willing to pay for the query payment transaction.
sourcepub fn max_payment_transaction_fee(&mut self, fee: Hbar) -> &mut Self
pub fn max_payment_transaction_fee(&mut self, fee: Hbar) -> &mut Self
Sets the maximum transaction fee the payer account is willing to pay for the query payment transaction.
Defaults to 1 hbar.
sourcepub fn get_payment_transaction_memo(&self) -> &str
pub fn get_payment_transaction_memo(&self) -> &str
Returns the note / description that should be recorded in the transaction record for the payment transaction.
sourcepub fn payment_transaction_memo(&mut self, memo: impl AsRef<str>) -> &mut Self
pub fn payment_transaction_memo(&mut self, memo: impl AsRef<str>) -> &mut Self
Sets a note / description that should be recorded in the transaction record for the payment transaction.
Maximum length of 100 characters.
sourcepub fn get_payment_transaction_id(&self) -> Option<TransactionId>
pub fn get_payment_transaction_id(&self) -> Option<TransactionId>
Returns the explicit transaction ID used to identify this query’s payment transaction, if set .
sourcepub fn payment_transaction_id(&mut self, id: TransactionId) -> &mut Self
pub fn payment_transaction_id(&mut self, id: TransactionId) -> &mut Self
Sets an explicit transaction ID to use to identify the payment transaction on this query.
Overrides payer account defined on this query or on the client.
source§impl<D> Query<D>where
D: QueryExecute,
impl<D> Query<D>where
D: QueryExecute,
sourcepub async fn execute(&mut self, client: &Client) -> Result<D::Response>
pub async fn execute(&mut self, client: &Client) -> Result<D::Response>
Execute this query against the provided client of the Hedera network.
sourcepub async fn execute_with_timeout(
&mut self,
client: &Client,
timeout: Duration
) -> Result<D::Response>
pub async fn execute_with_timeout( &mut self, client: &Client, timeout: Duration ) -> Result<D::Response>
Execute this query against the provided client of the Hedera network.
source§impl Query<ScheduleInfoQueryData>
impl Query<ScheduleInfoQueryData>
sourcepub fn get_schedule_id(&self) -> Option<ScheduleId>
pub fn get_schedule_id(&self) -> Option<ScheduleId>
Returns the schedule ID for which information is requested.
sourcepub fn schedule_id(&mut self, id: impl Into<ScheduleId>) -> &mut Self
pub fn schedule_id(&mut self, id: impl Into<ScheduleId>) -> &mut Self
Sets the schedule ID for which information is requested.
source§impl Query<TransactionReceiptQueryData>
impl Query<TransactionReceiptQueryData>
sourcepub fn get_transaction_id(&self) -> Option<TransactionId>
pub fn get_transaction_id(&self) -> Option<TransactionId>
Get the ID of the transaction for which the receipt is being requested.
sourcepub fn transaction_id(&mut self, transaction_id: TransactionId) -> &mut Self
pub fn transaction_id(&mut self, transaction_id: TransactionId) -> &mut Self
Sets the ID of the transaction for which the receipt is being requested.
sourcepub fn get_include_children(&self) -> bool
pub fn get_include_children(&self) -> bool
Whether the response should include the receipts of any child transactions spawned by the top-level transaction with the given transaction.
sourcepub fn include_children(&mut self, include: bool) -> &mut Self
pub fn include_children(&mut self, include: bool) -> &mut Self
Whether the response should include the receipts of any child transactions spawned by the top-level transaction with the given transaction.
sourcepub fn get_include_duplicates(&self) -> bool
pub fn get_include_duplicates(&self) -> bool
Whether receipts of processing duplicate transactions should be returned.
sourcepub fn include_duplicates(&mut self, include: bool) -> &mut Self
pub fn include_duplicates(&mut self, include: bool) -> &mut Self
Whether receipts of processing duplicate transactions should be returned.
sourcepub fn get_validate_status(&self) -> bool
pub fn get_validate_status(&self) -> bool
Whether the receipt status should be validated.
sourcepub fn validate_status(&mut self, validate: bool) -> &mut Self
pub fn validate_status(&mut self, validate: bool) -> &mut Self
Whether the receipt status should be validated.
source§impl Query<TransactionRecordQueryData>
impl Query<TransactionRecordQueryData>
sourcepub fn get_transaction_id(&self) -> Option<TransactionId>
pub fn get_transaction_id(&self) -> Option<TransactionId>
Get the ID of the transaction for which the record is being requested.
sourcepub fn transaction_id(&mut self, transaction_id: TransactionId) -> &mut Self
pub fn transaction_id(&mut self, transaction_id: TransactionId) -> &mut Self
Sets the ID of the transaction for which the record is being requested.
sourcepub fn get_include_children(&self) -> bool
pub fn get_include_children(&self) -> bool
Whether the response should include the records of any child transactions spawned by the top-level transaction with the given transaction.
sourcepub fn include_children(&mut self, include: bool) -> &mut Self
pub fn include_children(&mut self, include: bool) -> &mut Self
Whether the response should include the records of any child transactions spawned by the top-level transaction with the given transaction.
sourcepub fn get_include_duplicates(&self) -> bool
pub fn get_include_duplicates(&self) -> bool
Whether records of processing duplicate transactions should be returned.
sourcepub fn include_duplicates(&mut self, include: bool) -> &mut Self
pub fn include_duplicates(&mut self, include: bool) -> &mut Self
Whether records of processing duplicate transactions should be returned.
sourcepub fn get_validate_status(&self) -> bool
pub fn get_validate_status(&self) -> bool
Whether records of processing duplicate transactions should be returned.
sourcepub fn validate_status(&mut self, validate: bool) -> &mut Self
pub fn validate_status(&mut self, validate: bool) -> &mut Self
Whether the record status should be validated.
Trait Implementations§
Auto Trait Implementations§
impl<D> !Freeze for Query<D>
impl<D> !RefUnwindSafe for Query<D>
impl<D> Send for Query<D>
impl<D> Sync for Query<D>
impl<D> !Unpin for Query<D>
impl<D> !UnwindSafe for Query<D>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request