Trait seamless::api::ApiBody[][src]

pub trait ApiBody {
    fn api_body_info() -> ApiBodyInfo;

    fn to_json_vec(&self) -> Vec<u8>
Notable traits for Vec<u8, A>
impl<A> Write for Vec<u8, A> where
    A: Allocator

    where
        Self: Serialize
, { ... }
fn to_json_value(&self) -> Value
    where
        Self: Serialize
, { ... }
fn from_json_slice(bytes: &[u8]) -> Result<Self>
    where
        Self: DeserializeOwned
, { ... }
fn from_json_value(value: Value) -> Result<Self>
    where
        Self: DeserializeOwned
, { ... } }
Expand description

Any type that implements this trait can be described in terms of ApiBodyInfo, and can potentially also be serialized or deserizlied from JSON.

This type should not be manually implemented in most cases; instead the ApiBody macro should be relied on to ensure that the description and shape of the type are consistent with how it will be serialized.

In some cases however, it is necessary to manually implement this for a type (for example, an external type).

Required methods

This returns information about the shape of the type and description of parts of it.

Provided methods

Serialize the type to JSON.

Serialize the type to a serde_json::Value.

Deserialize from bytes containing a JSON value.

Deserialize from a serde_json::Value.

Implementations on Foreign Types

Implementors