[−][src]Struct df_st_api::api_objects::ApiItem
A Wrapper for an ApiObject
that includes additional metadata.
Fields
type_: String
A unique string identifier for this type.
links: ApiItemLinks
Links the various related items.
data: D
The included data item.
base_url: String
Server base url. Not included in response.
Implementations
impl<D> ApiItem<D> where
D: ApiObject + Default + Serialize + SchemaExample,
[src]
D: ApiObject + Default + Serialize + SchemaExample,
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) -> ApiItem<D>
[src]
Create and wrap the item. This is the same as doing:
ⓘThis example is not tested
let api_item = ApiItem::wrap_new(result_item, &server_info.base_url); // same as: let api_item = ApiItem::new(server_info); api_item.wrap(result_item);
Trait Implementations
impl<D: Clone> Clone for ApiItem<D> where
D: ApiObject + Serialize + SchemaExample,
[src]
D: ApiObject + Serialize + SchemaExample,
impl<D: Debug> Debug for ApiItem<D> where
D: ApiObject + Serialize + SchemaExample,
[src]
D: ApiObject + Serialize + SchemaExample,
impl<D: Default> Default for ApiItem<D> where
D: ApiObject + Serialize + SchemaExample,
[src]
D: ApiObject + Serialize + SchemaExample,
impl<'de, D> Deserialize<'de> for ApiItem<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 ApiItem<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 ApiItem<D> where
D: SchemaExample + Serialize + ApiObject,
[src]
D: SchemaExample + Serialize + ApiObject,
impl<D> Serialize for ApiItem<D> where
D: ApiObject + Serialize + SchemaExample,
D: Serialize,
[src]
D: ApiObject + Serialize + SchemaExample,
D: Serialize,
Auto Trait Implementations
impl<D> RefUnwindSafe for ApiItem<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
impl<D> Send for ApiItem<D> where
D: Send,
D: Send,
impl<D> Sync for ApiItem<D> where
D: Sync,
D: Sync,
impl<D> Unpin for ApiItem<D> where
D: Unpin,
D: Unpin,
impl<D> UnwindSafe for ApiItem<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>,