[−][src]Struct df_st_api::api_objects::ApiPage
A paged response from the API.
The actual requested data can be found in the data
object.
Fields
max_page_size: u32
The maximum amount of items in this response.
total_item_count: u32
The total amount of items. (across all pages) Note: id's usually start at 0 so if there are 10 total items the list id is 9. But id's can be missing so do not use this to calculate id's!
page_start: u32
The offset from the start of the database structure. This value takes the sorting of the page into account.
page_size: u32
The actual size of the response. (page_size<=max_page_size).
page_nr: u32
The number of the page.
This value is page_nr = page_start/max_page_size
order: Option<OrderTypes>
Order of the page. "asc" = A-Z, "desc" = Z-A. This field is only present if an order is set.
order_by: Option<String>
Name of the field for what it is ordered by. This field is only present if an order_by is set.
etag: String
Tag to identify this version of the page. More info here. This tag can be used to improve caching. ETag is a Sha256 of the whole response (including links and other metadata, excluding the etag itself.).
links: ApiPageLinks
Links the various related items.
data: Vec<ApiItem<D>>
List of actual requested data.
given_etag: String
The etag given in the request.
base_url: String
Server base url. Not included in response.
server_max_page_size: u32
Maximum amount of items requested on a page. Set by server at startup, see config. Not included in response.
Implementations
impl<D> ApiPage<D> where
D: ApiObject + Default + Serialize + SchemaExample,
[src]
D: ApiObject + Default + Serialize + SchemaExample,
pub fn new(
pagination: &ApiPagination,
server_info: &State<'_, ServerInfo>
) -> Self
[src]
pagination: &ApiPagination,
server_info: &State<'_, ServerInfo>
) -> Self
pub fn wrap(&mut self, list: Vec<D>) -> bool
[src]
Store the data in the object and construct links and calculate ETag. Return if true etag match with request tag.
pub fn get_db_order(&self) -> Option<OrderTypes>
[src]
Returns if the page should be sorted and in what order.
Trait Implementations
impl<D: Clone> Clone for ApiPage<D> where
D: ApiObject + Serialize + SchemaExample,
[src]
D: ApiObject + Serialize + SchemaExample,
impl<D: Debug> Debug for ApiPage<D> where
D: ApiObject + Serialize + SchemaExample,
[src]
D: ApiObject + Serialize + SchemaExample,
impl<D: Default> Default for ApiPage<D> where
D: ApiObject + Serialize + SchemaExample,
[src]
D: ApiObject + Serialize + SchemaExample,
impl<'de, D> Deserialize<'de> for ApiPage<D> where
D: ApiObject + Serialize + SchemaExample,
D: Deserialize<'de>,
[src]
D: ApiObject + Serialize + SchemaExample,
D: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<D: JsonSchema> JsonSchema for ApiPage<D> where
D: ApiObject + Serialize + SchemaExample,
[src]
D: ApiObject + Serialize + SchemaExample,
fn schema_name() -> String
[src]
fn json_schema(gen: &mut SchemaGenerator) -> Schema
[src]
fn is_referenceable() -> bool
impl<D> SchemaExample for ApiPage<D> where
D: SchemaExample + Serialize + ApiObject,
[src]
D: SchemaExample + Serialize + ApiObject,
impl<D> Serialize for ApiPage<D> where
D: ApiObject + Serialize + SchemaExample,
D: Serialize,
[src]
D: ApiObject + Serialize + SchemaExample,
D: Serialize,
Auto Trait Implementations
impl<D> RefUnwindSafe for ApiPage<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
impl<D> Send for ApiPage<D> where
D: Send,
D: Send,
impl<D> Sync for ApiPage<D> where
D: Sync,
D: Sync,
impl<D> Unpin for ApiPage<D> where
D: Unpin,
D: Unpin,
impl<D> UnwindSafe for ApiPage<D> where
D: UnwindSafe,
D: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, I> AsResult<T, I> for T where
I: Input,
I: Input,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T> IntoSql for T
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
&'a Self: AsExpression<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,