Struct jsonrpc_http_server::Response
[−]
[src]
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]
fn empty() -> Self
Create a response with empty body and 200 OK status code.
fn ok<T: Into<String>>(response: T) -> Self
Create a response with given body and 200 OK status code.
fn internal_error() -> Self
Create a response for internal error.
fn host_not_allowed() -> Self
Create a response for not allowed hosts.
fn unsupported_content_type() -> Self
Create a response for unsupported content type.
fn method_not_allowed() -> Self
Create a response for disallowed method used.
fn invalid_cors() -> Self
CORS invalid