pub struct TransactionHistoryRequest {
pub addresses: Vec<String>,
pub page_size: u32,
pub page_number: u32,
pub transaction_types: Vec<i32>,
pub start_time: Option<Timestamp>,
pub end_time: Option<Timestamp>,
}
Expand description
The pagination technique follows Google’s advice for grpc: https://cloud.google.com/apis/design/design_patterns#list_pagination
Fields§
§addresses: Vec<String>
SS58 public key address(es) whose history we are concerned with. Any transactions affecting these addresses will appear in the history, not just transactions an address has issued. Leaving this field empty, or as an empty list, results in all transactions being returned.
page_size: u32
Clients use this field to specify the maximum number of results to be returned by the server. The server may further constrain the maximum number of results returned in a single page. If the page_size is 0, the server will decide the number of results to be returned.
page_number: u32
Which page number to fetch.
This violates best practices around pagination. We should be using a cursor instead, but there’s not really a point until we’re using an actual database.
transaction_types: Vec<i32>
Types of transactions to return. If empty, transactions of all types are returned.
start_time: Option<Timestamp>
[Optional] Only transactions after the specified time are returned. Unbounded if none.
end_time: Option<Timestamp>
[Optional] Only transactions before the specified time are returned. Unbounded if none.
Implementations§
Source§impl TransactionHistoryRequest
impl TransactionHistoryRequest
Sourcepub fn transaction_types(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<TransactionType>>
pub fn transaction_types( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<TransactionType>>
Returns an iterator which yields the valid enum values contained in transaction_types
.
Sourcepub fn push_transaction_types(&mut self, value: TransactionType)
pub fn push_transaction_types(&mut self, value: TransactionType)
Appends the provided enum value to transaction_types
.
Trait Implementations§
Source§impl Clone for TransactionHistoryRequest
impl Clone for TransactionHistoryRequest
Source§fn clone(&self) -> TransactionHistoryRequest
fn clone(&self) -> TransactionHistoryRequest
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TransactionHistoryRequest
impl Debug for TransactionHistoryRequest
Source§impl Default for TransactionHistoryRequest
impl Default for TransactionHistoryRequest
Source§impl Message for TransactionHistoryRequest
impl Message for TransactionHistoryRequest
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
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<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
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<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.Source§impl PartialEq for TransactionHistoryRequest
impl PartialEq for TransactionHistoryRequest
Source§fn eq(&self, other: &TransactionHistoryRequest) -> bool
fn eq(&self, other: &TransactionHistoryRequest) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for TransactionHistoryRequest
Auto Trait Implementations§
impl Freeze for TransactionHistoryRequest
impl RefUnwindSafe for TransactionHistoryRequest
impl Send for TransactionHistoryRequest
impl Sync for TransactionHistoryRequest
impl Unpin for TransactionHistoryRequest
impl UnwindSafe for TransactionHistoryRequest
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