[−][src]Struct solana_jsonrpc_http_server::Response
Simple server response structure
Fields
code: StatusCode
Response code
content_type: HeaderValue
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<T: Into<String>>(msg: T) -> Self
[src]
pub fn internal_error<T: Into<String>>(msg: T) -> Self
Create a response for plaintext internal error.
Create a json response for service unavailable.
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_allow_origin() -> Self
[src]
pub fn invalid_allow_origin() -> Self
CORS invalid
pub fn invalid_allow_headers() -> Self
[src]
pub fn invalid_allow_headers() -> Self
CORS header 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 From<Response> for Response<Body>
[src]
impl From<Response> for Response<Body>
fn from(res: Response) -> Response<Body>
[src]
fn from(res: Response) -> Response<Body>
Converts from a jsonrpc Response
to a hyper::Response
Panics
Panics if the response cannot be converted due to failure to parse body content.
impl From<Response> for RequestMiddlewareAction
[src]
impl From<Response> for RequestMiddlewareAction
impl Debug for Response
[src]
impl Debug for Response
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> Erased for T
impl<T> Erased for T