pub struct HttpResponse {
pub metadata_id: LiveId,
pub status_code: u16,
pub headers: BTreeMap<String, Vec<String>>,
pub body: Option<Vec<u8>>,
}
Fields§
§metadata_id: LiveId
§status_code: u16
§headers: BTreeMap<String, Vec<String>>
§body: Option<Vec<u8>>
Implementations§
Source§impl HttpResponse
impl HttpResponse
pub fn new( metadata_id: LiveId, status_code: u16, string_headers: String, body: Option<Vec<u8>>, ) -> HttpResponse
pub fn set_header(&mut self, name: String, value: String)
pub fn get_body(&self) -> Option<&Vec<u8>>
pub fn get_string_body(&self) -> Option<String>
pub fn get_json_body<T>(&self) -> Result<T, DeJsonErr>where
T: DeJson,
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> ActionTrait for T
impl<T> ActionTrait for T
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