pub struct PageRequest {
pub key: Vec<u8>,
pub offset: u64,
pub limit: u64,
pub count_total: bool,
pub reverse: bool,
}
Expand description
PageRequest is to be embedded in gRPC request messages for efficient pagination. Ex:
message SomeRequest { Foo some_parameter = 1; PageRequest pagination = 2; }
Fields§
§key: Vec<u8>
key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.
offset: u64
offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.
limit: u64
limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.
count_total: bool
count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.
reverse: bool
reverse is set to true if results are to be returned in the descending order.
Since: cosmos-sdk 0.43
Implementations§
Trait Implementations§
Source§impl Clone for PageRequest
impl Clone for PageRequest
Source§fn clone(&self) -> PageRequest
fn clone(&self) -> PageRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PageRequest
impl Debug for PageRequest
Source§impl Default for PageRequest
impl Default for PageRequest
Source§impl<'de> Deserialize<'de> for PageRequest
impl<'de> Deserialize<'de> for PageRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<PageRequest> for Binary
impl From<PageRequest> for Binary
Source§fn from(msg: PageRequest) -> Self
fn from(msg: PageRequest) -> Self
Source§impl<T> From<PageRequest> for CosmosMsg<T>
impl<T> From<PageRequest> for CosmosMsg<T>
Source§fn from(msg: PageRequest) -> Self
fn from(msg: PageRequest) -> Self
Source§impl JsonSchema for PageRequest
impl JsonSchema for PageRequest
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§impl Message for PageRequest
impl Message for PageRequest
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
.