Trait longport_httpcli::ToPayload

source ·
pub trait ToPayload: Sized + Send + Sync + 'static {
    type Err: Error;

    // Required method
    fn to_bytes(&self) -> Result<Vec<u8>, Self::Err>;
}
Expand description

Represents a type that can convert to payload

Required Associated Types§

source

type Err: Error

A error type

Required Methods§

source

fn to_bytes(&self) -> Result<Vec<u8>, Self::Err>

Convert this object to the payload

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ToPayload for ()

§

type Err = Infallible

source§

fn to_bytes(&self) -> Result<Vec<u8>, Self::Err>

source§

impl ToPayload for String

§

type Err = FromUtf8Error

source§

fn to_bytes(&self) -> Result<Vec<u8>, Self::Err>

Implementors§

source§

impl<T> ToPayload for Json<T>
where T: Serialize + Send + Sync + 'static,

§

type Err = Error