jsonrpsee_types::response

Struct Response

source
pub struct Response<'a, T: Clone> {
    pub jsonrpc: Option<TwoPointZero>,
    pub payload: ResponsePayload<'a, T>,
    pub id: Id<'a>,
}
Expand description

JSON-RPC response object as defined in the spec.

Fields§

§jsonrpc: Option<TwoPointZero>

JSON-RPC version.

§payload: ResponsePayload<'a, T>

Payload which can be result or error.

§id: Id<'a>

Request ID

Implementations§

source§

impl<'a, T: Clone> Response<'a, T>

source

pub fn new(payload: ResponsePayload<'a, T>, id: Id<'a>) -> Response<'a, T>

Create a new Response.

source

pub fn into_owned(self) -> Response<'static, T>

Create an owned Response.

Trait Implementations§

source§

impl<'a, T> Debug for Response<'a, T>
where T: Serialize + Clone,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, T> Deserialize<'de> for Response<'de, T>
where T: Deserialize<'de> + Clone,

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>, T: Deserialize<'de> + Clone,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'a, T> Display for Response<'a, T>
where T: Serialize + Clone,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, T> Serialize for Response<'a, T>
where T: Serialize + Clone,

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a, T: Clone> TryFrom<Response<'a, T>> for Success<'a, T>

source§

type Error = ErrorObject<'static>

The type returned in the event of a conversion error.
source§

fn try_from(rp: Response<'a, T>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'a, T> Freeze for Response<'a, T>
where T: Freeze,

§

impl<'a, T> RefUnwindSafe for Response<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for Response<'a, T>
where T: Send + Sync,

§

impl<'a, T> Sync for Response<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for Response<'a, T>
where T: Unpin,

§

impl<'a, T> UnwindSafe for Response<'a, T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.