pub struct QueryHeader {
pub payment: Option<Transaction>,
pub response_type: i32,
}Expand description
A standard query header.
Each query from the client to the node must contain a QueryHeader, which
specifies the desired response type, and includes a payment transaction
that will compensate the network for responding to the query.
The payment may be blank if the query is free.
The payment transaction MUST be a cryptoTransfer from the payer account
to the account of the node where the query is submitted.
If the payment is sufficient, the network SHALL respond with the response
type requested.
If the response type is COST_ANSWER the payment MUST be unset.
A state proof SHALL be available for some types of information.
A state proof SHALL be available for a Record, but not a receipt, and the
response entry for each supported “get info” query.
Fields§
§payment: Option<Transaction>A signed CryptoTransferTransaction to pay query fees.
This MUST transfer HBAR from the "payer" to the responding node account sufficient to pay the query fees.
response_type: i32A type of query response requested.
Implementations§
Source§impl QueryHeader
impl QueryHeader
Sourcepub fn response_type(&self) -> ResponseType
pub fn response_type(&self) -> ResponseType
Returns the enum value of response_type, or the default if the field is set to an invalid enum value.
Sourcepub fn set_response_type(&mut self, value: ResponseType)
pub fn set_response_type(&mut self, value: ResponseType)
Sets response_type to the provided enum value.
Trait Implementations§
Source§impl Clone for QueryHeader
impl Clone for QueryHeader
Source§fn clone(&self) -> QueryHeader
fn clone(&self) -> QueryHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QueryHeader
impl Debug for QueryHeader
Source§impl Default for QueryHeader
impl Default for QueryHeader
Source§impl Message for QueryHeader
impl Message for QueryHeader
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for QueryHeader
impl PartialEq for QueryHeader
impl StructuralPartialEq for QueryHeader
Auto Trait Implementations§
impl Freeze for QueryHeader
impl RefUnwindSafe for QueryHeader
impl Send for QueryHeader
impl Sync for QueryHeader
impl Unpin for QueryHeader
impl UnsafeUnpin for QueryHeader
impl UnwindSafe for QueryHeader
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> 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