[][src]Struct rs_jsonrpc_http_server::Response

pub struct Response {
    pub code: StatusCode,
    pub content_type: ContentType,
    pub content: String,
}

Simple server response structure

Fields

code: StatusCode

Response code

content_type: ContentType

Response content type

content: String

Response body

Methods

impl Response[src]

pub fn empty() -> Self[src]

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

pub fn ok<T: Into<String>>(response: T) -> Self[src]

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

pub fn internal_error() -> Self[src]

Create a response for internal error.

pub fn host_not_allowed() -> Self[src]

Create a response for not allowed hosts.

pub fn unsupported_content_type() -> Self[src]

Create a response for unsupported content type.

pub fn method_not_allowed() -> Self[src]

Create a response for disallowed method used.

pub fn invalid_cors() -> Self[src]

CORS invalid

Trait Implementations

impl From<Response> for RequestMiddlewareAction[src]

impl Into<Response<Body>> for Response[src]

impl Debug for Response[src]

Auto Trait Implementations

impl Send for Response

impl Sync for Response

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T