pub struct Response {
pub status: Status,
pub headers: Headers,
pub method: Method,
pub body: Bytes,
}
Fields§
§status: Status
§headers: Headers
§method: Method
§body: Bytes
Implementations§
Source§impl Response
impl Response
pub fn from_header(header: &[u8]) -> Result<Response, Error>
pub fn try_from<T: Write>(res: &[u8], writer: &mut T) -> Result<Response, Error>
pub fn status_code(&self) -> StatusCode
pub fn version(&self) -> Version
pub fn reason(&self) -> &str
pub fn headers(&self) -> &Headers
pub fn header(&self, value: &str) -> Option<String>
pub fn content_len(&self) -> Option<usize>
pub fn body(&self) -> Bytes
pub fn text(&self) -> Result<String, Error>
pub fn has_body(&self) -> bool
pub fn has_chuncked_body(&self) -> bool
Trait Implementations§
impl Eq for Response
impl StructuralPartialEq for Response
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