Struct jsonrpc_http_server::Response[][src]

pub struct Response {
    pub code: StatusCode,
    pub content_type: HeaderValue,
    pub content: String,
}
Expand description

Simple server response structure

Fields

code: StatusCode

Response code

content_type: HeaderValue

Response content type

content: String

Response body

Implementations

Create a response with empty body and 200 OK status code.

Create a response with given body and 200 OK status code.

Create a response for plaintext internal error.

Create a json response for service unavailable.

Create a response for not allowed hosts.

Create a response for unsupported content type.

Create a response for disallowed method used.

CORS invalid

CORS header invalid

Create a response for bad request

Create a response for too large (413)

Trait Implementations

Formats the value using the given formatter. Read more

Converts from a jsonrpc Response to a hyper::Response

Panics

Panics if the response cannot be converted due to failure to parse body content.

Performs the conversion.

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

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

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.