pub struct ResponseState {
pub status: u16,
pub headers: HashMap<String, String>,
pub body: Vec<u8>,
}Fields§
§status: u16§headers: HashMap<String, String>§body: Vec<u8>Implementations§
Source§impl ResponseState
impl ResponseState
pub const HTML: &'static str = "text/html; charset=utf-8"
pub const PLAIN: &'static str = "text/plain"
pub fn html(status: StatusCode, body: impl Into<String>) -> Self
pub fn plain(status: StatusCode, body: impl Into<String>) -> Self
pub fn internal_error(body: impl Into<String>) -> Self
pub fn add_watch_script(&mut self, port_watch: u16)
Trait Implementations§
Source§impl Debug for ResponseState
impl Debug for ResponseState
Source§impl From<ResponseState> for HttpResponse
impl From<ResponseState> for HttpResponse
Source§fn from(value: ResponseState) -> Self
fn from(value: ResponseState) -> Self
Converts to this type from the input type.
Source§impl JsJsonDeserialize for ResponseState
impl JsJsonDeserialize for ResponseState
fn from_json( context: JsJsonContext, json: JsJson, ) -> Result<Self, JsJsonContext>
Source§impl JsJsonSerialize for ResponseState
impl JsJsonSerialize for ResponseState
Auto Trait Implementations§
impl Freeze for ResponseState
impl RefUnwindSafe for ResponseState
impl Send for ResponseState
impl Sync for ResponseState
impl Unpin for ResponseState
impl UnsafeUnpin for ResponseState
impl UnwindSafe for ResponseState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more