pub struct PaginatedResponse<T> {
pub records: Vec<T>,
pub total_records: u64,
pub total_pages: u64,
}Expand description
A page of a list, with the totals the broker reports.
Pages count from 0. total_records and total_pages are for the whole result of the filter, not for
this page. The lists of orders and trades hold at most the 1000 latest records (broker docs).
§Examples
use brokapi_bcs_protocol::http::models::PaginatedResponse;
let page: PaginatedResponse<String> =
serde_json::from_str(r#"{"records":["a","b"],"totalRecords":2,"totalPages":1}"#)?;
assert_eq!((page.records.len(), page.total_pages), (2, 1));Fields§
§records: Vec<T>The records of this page.
total_records: u64Number of records for the whole filter.
total_pages: u64Number of pages for the whole filter, at the page size of the request.
Trait Implementations§
Source§impl<T: Clone> Clone for PaginatedResponse<T>
impl<T: Clone> Clone for PaginatedResponse<T>
Source§fn clone(&self) -> PaginatedResponse<T>
fn clone(&self) -> PaginatedResponse<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for PaginatedResponse<T>
impl<T: Debug> Debug for PaginatedResponse<T>
Source§impl<'de, T> Deserialize<'de> for PaginatedResponse<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for PaginatedResponse<T>where
T: Deserialize<'de>,
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<T> Freeze for PaginatedResponse<T>
impl<T> RefUnwindSafe for PaginatedResponse<T>where
T: RefUnwindSafe,
impl<T> Send for PaginatedResponse<T>where
T: Send,
impl<T> Sync for PaginatedResponse<T>where
T: Sync,
impl<T> Unpin for PaginatedResponse<T>where
T: Unpin,
impl<T> UnsafeUnpin for PaginatedResponse<T>
impl<T> UnwindSafe for PaginatedResponse<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more