pub struct HttpResponse { /* private fields */ }
Implementations§
Source§impl HttpResponse
impl HttpResponse
Sourcepub fn new(status: &u16, headers: &Vec<String>, body: &String) -> Self
pub fn new(status: &u16, headers: &Vec<String>, body: &String) -> Self
Instantiate response with minimal properties
Sourcepub fn new_full(
status: &u16,
headers: &HttpHeaders,
body: &String,
version: &String,
reason: &String,
) -> Self
pub fn new_full( status: &u16, headers: &HttpHeaders, body: &String, version: &String, reason: &String, ) -> Self
Instantiate new response with all properties
Sourcepub fn status_code(&self) -> u16
pub fn status_code(&self) -> u16
Get HTTP status code
Sourcepub fn headers(&self) -> HttpHeaders
pub fn headers(&self) -> HttpHeaders
Get http headers
Sourcepub fn read_header(
reader: &mut Box<dyn BufRead>,
req: &HttpRequest,
dest_file: &str,
) -> Result<Self, Error>
pub fn read_header( reader: &mut Box<dyn BufRead>, req: &HttpRequest, dest_file: &str, ) -> Result<Self, Error>
Read first line and header of response
Sourcepub fn parse_first_line(
first_line: &str,
req: &HttpRequest,
) -> Result<(String, u16, String), Error>
pub fn parse_first_line( first_line: &str, req: &HttpRequest, ) -> Result<(String, u16, String), Error>
Parse first line
Trait Implementations§
Source§impl Clone for HttpResponse
impl Clone for HttpResponse
Source§fn clone(&self) -> HttpResponse
fn clone(&self) -> HttpResponse
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for HttpResponse
impl RefUnwindSafe for HttpResponse
impl Send for HttpResponse
impl Sync for HttpResponse
impl Unpin for HttpResponse
impl UnwindSafe for HttpResponse
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