pub struct HttpResponse<B: Read> {
pub status: HttpStatus,
pub headers: HttpHeaders,
pub body: HttpBody<B>,
/* private fields */
}
Fields§
§status: HttpStatus
§headers: HttpHeaders
§body: HttpBody<B>
Implementations§
Source§impl HttpResponse<Box<dyn Read>>
impl HttpResponse<Box<dyn Read>>
pub fn from_string<S: Into<String>>(status: HttpStatus, s: S) -> Self
Source§impl<B: Read> HttpResponse<B>
impl<B: Read> HttpResponse<B>
pub fn new(status: HttpStatus, body: B) -> Self
pub fn deserialize(socket: B) -> Result<Self>
pub fn get_header(&self, key: &str) -> Option<&str>
pub fn add_header(&mut self, key: impl AsRef<str>, value: impl Into<String>)
pub fn serialize<W: Write>(&self, w: W) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for HttpResponse<B>where
B: Freeze,
impl<B> RefUnwindSafe for HttpResponse<B>where
B: RefUnwindSafe,
impl<B> Send for HttpResponse<B>where
B: Send,
impl<B> Sync for HttpResponse<B>where
B: Sync,
impl<B> Unpin for HttpResponse<B>where
B: Unpin,
impl<B> UnwindSafe for HttpResponse<B>where
B: UnwindSafe,
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