Struct embedded_svc::httpd::Response
source · [−]pub struct Response {
pub status: u16,
pub status_message: Option<String>,
pub headers: BTreeMap<String, String>,
pub body: Body,
pub new_session_state: Option<SessionState>,
}
Fields
status: u16
status_message: Option<String>
headers: BTreeMap<String, String>
body: Body
new_session_state: Option<SessionState>
Implementations
sourceimpl Response
impl Response
pub fn ok() -> Self
pub fn redirect(location: impl Into<String>) -> Self
pub fn new(status_code: u16) -> Self
pub fn status(self, status: u16) -> Self
pub fn status_message(self, message: impl Into<String>) -> Self
pub fn header(self, name: &str, value: impl Into<String>) -> Self
pub fn content_encoding(self, value: impl Into<String>) -> Self
pub fn content_type(self, value: impl Into<String>) -> Self
pub fn content_len(self, value: usize) -> Self
pub fn body(self, body: Body) -> Self
pub fn new_session_state(self, new_session_state: SessionState) -> Self
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Response
impl !Send for Response
impl !Sync for Response
impl Unpin for Response
impl !UnwindSafe for Response
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more