pub struct Response {
pub headers: HashMap<String, String>,
pub status_line: String,
pub body: Option<Vec<u8>>,
pub mime: Option<String>,
pub http2: bool,
/* private fields */
}Fields§
§headers: HashMap<String, String>§status_line: String§body: Option<Vec<u8>>§mime: Option<String>§http2: boolImplementations§
source§impl Response
impl Response
pub fn new() -> Response
pub fn empty() -> Response
pub fn headers(self, headers: HashMap<String, String>) -> Self
pub fn status_line<P: Into<String>>(self, line: P) -> Self
pub fn body(self, body: Vec<u8>) -> Self
pub fn mime<P>(self, mime: P) -> Self
pub fn send<P: Read + Write>(self, sock: &mut P)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)