[][src]Struct df_st_api::api_objects::ApiMinimalItem

pub struct ApiMinimalItem<D> where
    D: ApiObject + Serialize + SchemaExample
{ pub type_: String, pub data: D, pub base_url: String, }

A Wrapper for an ApiObject that includes additional metadata.

Fields

type_: String

A unique string identifier for this type.

data: D

The included data item.

base_url: String

Server base url. Not included in response.

Implementations

impl<D> ApiMinimalItem<D> where
    D: ApiObject + Default + Serialize + SchemaExample
[src]

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

pub fn wrap(&mut self, item: D)[src]

Store the data in the object and construct links.

pub fn wrap_new(item: D, base_url: &str) -> ApiMinimalItem<D>[src]

Create and wrap the item. This is the same as doing:

This example is not tested
let api_item = ApiMinimalItem::wrap_new(result_item, &server_info.base_url);
// same as:
let api_item = ApiMinimalItem::new(server_info);
api_item.wrap(result_item);

Trait Implementations

impl<D: Clone> Clone for ApiMinimalItem<D> where
    D: ApiObject + Serialize + SchemaExample
[src]

impl<D: Debug> Debug for ApiMinimalItem<D> where
    D: ApiObject + Serialize + SchemaExample
[src]

impl<D: Default> Default for ApiMinimalItem<D> where
    D: ApiObject + Serialize + SchemaExample
[src]

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

impl<D: JsonSchema> JsonSchema for ApiMinimalItem<D> where
    D: ApiObject + Serialize + SchemaExample
[src]

impl<D> SchemaExample for ApiMinimalItem<D> where
    D: SchemaExample + Serialize + ApiObject
[src]

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

Auto Trait Implementations

impl<D> RefUnwindSafe for ApiMinimalItem<D> where
    D: RefUnwindSafe

impl<D> Send for ApiMinimalItem<D> where
    D: Send

impl<D> Sync for ApiMinimalItem<D> where
    D: Sync

impl<D> Unpin for ApiMinimalItem<D> where
    D: Unpin

impl<D> UnwindSafe for ApiMinimalItem<D> where
    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>,