pub struct Response {
pub request: Request,
pub headers: Option<Headers>,
pub status: Option<usize>,
pub fixed_content: Option<String>,
}
Fields§
§request: Request
§headers: Option<Headers>
§status: Option<usize>
§fixed_content: Option<String>
Implementations§
Source§impl Response
impl Response
pub fn new(request: Request) -> Self
pub fn set_content_type(&mut self, text: &str)
Sourcepub fn add_header(&mut self, name: &str, value: &str) -> &mut Self
pub fn add_header(&mut self, name: &str, value: &str) -> &mut Self
Headers will be keep appending to the list if already exists
pub fn html<T: StatusCode>(&mut self, status: T, text: String) -> &mut Self
pub fn json<T: StatusCode>(&mut self, status: T, text: String) -> &mut Self
pub fn set_content(&mut self, status: usize, text: String) -> &mut Self
pub fn send(&mut self)
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