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: bool
Implementations§
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