pub struct Response { /* private fields */ }Implementations§
source§impl Response
impl Response
pub fn new(stream: TcpStream, version: &String) -> Self
pub fn set_header(&mut self, name: &str, value: &str)
pub fn remove_header(&mut self, name: &str)
pub fn header(&self, name: &str) -> Option<&String>
pub fn status(&self) -> &StatusCode
pub fn set_status(&mut self, status: StatusCode)
pub async fn send_status(&mut self, status: StatusCode)
pub fn content_type(&self) -> Option<&String>
pub fn set_content_type(&mut self, content_type: Mime)
pub async fn json<T>(&mut self, data: T)where T: Object,
pub async fn send(&mut self)
Trait Implementations§
Auto Trait Implementations§
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