pub struct HttpResponse {
pub status_code: u16,
pub status_text: String,
pub headers: Vec<(String, String)>,
pub body: Vec<u8>,
}Fields§
§status_code: u16§status_text: String§headers: Vec<(String, String)>§body: Vec<u8>Implementations§
Source§impl HttpResponse
impl HttpResponse
pub fn new(status_code: u16, status_text: String) -> HttpResponse
pub fn is_success(&self) -> bool
pub fn is_redirect(&self) -> bool
pub fn is_partial_content(&self) -> bool
pub fn is_client_error(&self) -> bool
pub fn is_server_error(&self) -> bool
pub fn header(&self, name: &str) -> Option<&String>
pub fn header_all(&self, name: &str) -> Vec<&String>
pub fn content_length(&self) -> Option<u64>
pub fn content_type(&self) -> Option<&str>
pub fn content_encoding(&self) -> Option<&str>
pub fn content_disposition(&self) -> Option<&str>
pub fn accept_ranges(&self) -> bool
pub fn location(&self) -> Option<&str>
pub fn etag(&self) -> Option<&str>
pub fn last_modified(&self) -> Option<&str>
pub fn server(&self) -> Option<&str>
pub fn connection(&self) -> Option<&str>
pub fn transfer_encoding(&self) -> Option<&str>
pub fn body_as_utf8(&self) -> Result<&str, Utf8Error>
pub fn body_len(&self) -> usize
pub fn parse_content_range(&self) -> Option<ContentRange>
Trait Implementations§
Source§impl Clone for HttpResponse
impl Clone for HttpResponse
Source§fn clone(&self) -> HttpResponse
fn clone(&self) -> HttpResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 UnsafeUnpin 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