[][src]Struct df_st_api::api_objects::ApiCountPage

pub struct ApiCountPage<C, D> where
    C: ApiObject + Serialize + SchemaExample,
    D: ApiObject + Serialize + SchemaExample
{ pub max_page_size: u32, pub total_item_count: u32, pub page_start: u32, pub page_size: u32, pub page_nr: u32, pub group_by: Option<String>, pub etag: String, pub links: ApiPageLinks, pub data: Vec<ApiMinimalItem<C>>, pub given_etag: String, pub base_url: String, pub server_max_page_size: u32, // some fields omitted }

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 if 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

group_by: Option<String>

Name of the field it is grouped by.

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<ApiMinimalItem<C>>

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<C, D> ApiCountPage<C, D> where
    C: ApiObject + Default + Serialize + SchemaExample,
    D: ApiObject + Default + Serialize + SchemaExample
[src]

pub fn new(
    pagination: &ApiMinimalPagination,
    server_info: &State<'_, ServerInfo>
) -> Self
[src]

pub fn wrap(&mut self, list: Vec<C>) -> bool[src]

Store the data in the object and construct links and calculate ETag. Return if true etag match with request tag.

Trait Implementations

impl<C: Clone, D: Clone> Clone for ApiCountPage<C, D> where
    C: ApiObject + Serialize + SchemaExample,
    D: ApiObject + Serialize + SchemaExample
[src]

impl<C: Debug, D: Debug> Debug for ApiCountPage<C, D> where
    C: ApiObject + Serialize + SchemaExample,
    D: ApiObject + Serialize + SchemaExample
[src]

impl<C: Default, D: Default> Default for ApiCountPage<C, D> where
    C: ApiObject + Serialize + SchemaExample,
    D: ApiObject + Serialize + SchemaExample
[src]

impl<'de, C, D> Deserialize<'de> for ApiCountPage<C, D> where
    C: ApiObject + Serialize + SchemaExample,
    D: ApiObject + Serialize + SchemaExample,
    C: Deserialize<'de>,
    D: Default
[src]

impl<C: JsonSchema, D: JsonSchema> JsonSchema for ApiCountPage<C, D> where
    C: ApiObject + Serialize + SchemaExample,
    D: ApiObject + Serialize + SchemaExample
[src]

impl<C, D> SchemaExample for ApiCountPage<C, D> where
    C: SchemaExample + Serialize + ApiObject,
    D: SchemaExample + Serialize + ApiObject
[src]

impl<C, D> Serialize for ApiCountPage<C, D> where
    C: ApiObject + Serialize + SchemaExample,
    D: ApiObject + Serialize + SchemaExample,
    C: Serialize
[src]

Auto Trait Implementations

impl<C, D> RefUnwindSafe for ApiCountPage<C, D> where
    C: RefUnwindSafe,
    D: RefUnwindSafe

impl<C, D> Send for ApiCountPage<C, D> where
    C: Send,
    D: Send

impl<C, D> Sync for ApiCountPage<C, D> where
    C: Sync,
    D: Sync

impl<C, D> Unpin for ApiCountPage<C, D> where
    C: Unpin,
    D: Unpin

impl<C, D> UnwindSafe for ApiCountPage<C, D> where
    C: UnwindSafe,
    D: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, I> AsResult<T, I> for T where
    I: Input, 

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoCollection<T> for T

impl<T> IntoSql for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,