[−][src]Struct jsonrpc_http_server::Response
Simple server response structure
Fields
code: StatusCodeResponse code
content_type: HeaderValueResponse content type
content: StringResponse body
Implementations
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<T: Into<String>>(msg: T) -> Self[src]
Create a response for plaintext internal error.
pub fn service_unavailable<T: Into<String>>(msg: T) -> Self[src]
Create a json response for service unavailable.
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_allow_origin() -> Self[src]
CORS invalid
pub fn invalid_allow_headers() -> Self[src]
CORS header invalid
pub fn bad_request<S: Into<String>>(msg: S) -> Self[src]
Create a response for bad request
pub fn too_large<S: Into<String>>(msg: S) -> Self[src]
Create a response for too large (413)
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Response[src]
impl Send for Response[src]
impl Sync for Response[src]
impl Unpin for Response[src]
impl UnwindSafe for Response[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,