pub struct Response {
pub content_type: String,
pub content_length: usize,
pub status_text: String,
pub status: i64,
pub body: Value,
pub raw: String,
pub cookies: HashMap<String, String>,
pub is_file: bool,
}
Fields§
§content_type: String
§content_length: usize
§status_text: String
§status: i64
§body: Value
§raw: String
§is_file: bool
Implementations§
Source§impl Response
impl Response
pub fn new() -> Self
pub fn text(&self, body: &str, status: i64) -> Response
pub fn json(&self, body: Value, status: i64) -> Response
pub fn error(&self, body: &str, status: i64) -> Response
pub fn send_file(&self, path: &str, status: i64) -> Response
pub fn render(&self, path: &str, status: i64) -> 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