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.
Trait Implementations
Returns the encoded length of the message without a length delimiter.
Encodes the message to a buffer. Read more
Encodes the message to a newly allocated buffer.
Encodes the message with a length-delimiter to a buffer. Read more
Encodes the message with a length-delimiter to a newly allocated buffer.
Decodes an instance of the message from a buffer. Read more
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Decodes an instance of the message from a buffer, and merges it into self
. Read more
Decodes a length-delimited instance of the message from buffer, and
merges it into self
. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for PageRequest
impl Send for PageRequest
impl Sync for PageRequest
impl Unpin for PageRequest
impl UnwindSafe for PageRequest
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more