Skip to main content

IntoResponse

Trait IntoResponse 

pub trait IntoResponse {
    type Output: Serialize + Clone;

    // Required method
    fn into_response(self) -> ResponsePayload<'static, Self::Output>;
}
Available on crate feature server-core only.
Expand description

Something that can be converted into a JSON-RPC method call response.

If the value couldn’t be serialized/encoded, jsonrpsee will sent out an error to the client response could not be serialized.

Required Associated Types§

type Output: Serialize + Clone

Output.

Required Methods§

fn into_response(self) -> ResponsePayload<'static, Self::Output>

Something that can be converted into a JSON-RPC method call response.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl IntoResponse for &'static str

§

type Output = &'static str

§

fn into_response( self, ) -> ResponsePayload<'static, <&'static str as IntoResponse>::Output>

§

impl IntoResponse for ()

§

type Output = ()

§

fn into_response(self) -> ResponsePayload<'static, <() as IntoResponse>::Output>

§

impl IntoResponse for ErrorObject<'static>

§

type Output = ()

§

fn into_response( self, ) -> ResponsePayload<'static, <ErrorObject<'static> as IntoResponse>::Output>

§

impl IntoResponse for String

§

impl IntoResponse for Value

§

impl IntoResponse for bool

§

type Output = bool

§

fn into_response( self, ) -> ResponsePayload<'static, <bool as IntoResponse>::Output>

§

impl IntoResponse for i8

§

type Output = i8

§

fn into_response(self) -> ResponsePayload<'static, <i8 as IntoResponse>::Output>

§

impl IntoResponse for i16

§

type Output = i16

§

fn into_response( self, ) -> ResponsePayload<'static, <i16 as IntoResponse>::Output>

§

impl IntoResponse for i32

§

type Output = i32

§

fn into_response( self, ) -> ResponsePayload<'static, <i32 as IntoResponse>::Output>

§

impl IntoResponse for i64

§

type Output = i64

§

fn into_response( self, ) -> ResponsePayload<'static, <i64 as IntoResponse>::Output>

§

impl IntoResponse for i128

§

type Output = i128

§

fn into_response( self, ) -> ResponsePayload<'static, <i128 as IntoResponse>::Output>

§

impl IntoResponse for isize

§

impl IntoResponse for u8

§

type Output = u8

§

fn into_response(self) -> ResponsePayload<'static, <u8 as IntoResponse>::Output>

§

impl IntoResponse for u16

§

type Output = u16

§

fn into_response( self, ) -> ResponsePayload<'static, <u16 as IntoResponse>::Output>

§

impl IntoResponse for u32

§

type Output = u32

§

fn into_response( self, ) -> ResponsePayload<'static, <u32 as IntoResponse>::Output>

§

impl IntoResponse for u64

§

type Output = u64

§

fn into_response( self, ) -> ResponsePayload<'static, <u64 as IntoResponse>::Output>

§

impl IntoResponse for u128

§

type Output = u128

§

fn into_response( self, ) -> ResponsePayload<'static, <u128 as IntoResponse>::Output>

§

impl IntoResponse for usize

§

impl<T, E> IntoResponse for Result<T, E>
where E: Into<ErrorObject<'static>>, T: Serialize + Clone,

§

type Output = T

§

fn into_response( self, ) -> ResponsePayload<'static, <Result<T, E> as IntoResponse>::Output>

§

impl<T, const N: usize> IntoResponse for [T; N]

§

impl<T> IntoResponse for Option<T>
where T: Serialize + Clone,

§

type Output = Option<T>

§

fn into_response( self, ) -> ResponsePayload<'static, <Option<T> as IntoResponse>::Output>

§

impl<T> IntoResponse for Vec<T>
where T: Serialize + Clone,

§

type Output = Vec<T>

§

fn into_response( self, ) -> ResponsePayload<'static, <Vec<T> as IntoResponse>::Output>

Implementors§

§

impl<T> IntoResponse for ResponsePayload<'static, T>
where T: Serialize + Clone,

§

type Output = T