pub struct Response { /* private fields */ }
Expand description

A successful or failed JSON-RPC response.

Implementations

Creates a new successful response from a request ID and Error object.

Creates a new error response from a request ID and Error object.

Creates a new response from a request ID and either an Ok(Value) or Err(Error) body.

Splits the response into a request ID paired with either an Ok(Value) or Err(Error) to signify whether the response is a success or failure.

Returns true if the response indicates success.

Returns true if the response indicates failure.

Returns the result value, if it exists.

This member only exists if the response indicates success.

Returns the error value, if it exists.

This member only exists if the response indicates failure.

Returns the corresponding request ID, if known.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Routes client-to-server responses back to the server.

The type of value produced by the sink when an error occurs.

Attempts to prepare the Sink to receive a value. Read more

Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready which returned Poll::Ready(Ok(())). Read more

Flush any remaining output from this sink. Read more

Flush any remaining output and close this sink, if necessary. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.