Struct solana_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]
impl Response
pub fn empty() -> Self
[src]
pub fn empty() -> Self
Create a response with empty body and 200 OK status code.
pub fn ok<T: Into<String>>(response: T) -> Self
[src]
pub fn ok<T: Into<String>>(response: T) -> Self
Create a response with given body and 200 OK status code.
pub fn internal_error() -> Self
[src]
pub fn internal_error() -> Self
Create a response for internal error.
pub fn host_not_allowed() -> Self
[src]
pub fn host_not_allowed() -> Self
Create a response for not allowed hosts.
pub fn unsupported_content_type() -> Self
[src]
pub fn unsupported_content_type() -> Self
Create a response for unsupported content type.
pub fn method_not_allowed() -> Self
[src]
pub fn method_not_allowed() -> Self
Create a response for disallowed method used.
pub fn invalid_cors() -> Self
[src]
pub fn invalid_cors() -> Self
CORS invalid
pub fn bad_request<S: Into<String>>(msg: S) -> Self
[src]
pub fn bad_request<S: Into<String>>(msg: S) -> Self
Create a response for bad request
pub fn too_large<S: Into<String>>(msg: S) -> Self
[src]
pub fn too_large<S: Into<String>>(msg: S) -> Self
Create a response for too large (413)
Trait Implementations
impl Debug for Response
[src]
impl Debug for Response
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Into<Response> for Response
[src]
impl Into<Response> for Response
impl From<Response> for RequestMiddlewareAction
[src]
impl From<Response> for RequestMiddlewareAction