pub struct Response { /* private fields */ }Implementations§
Source§impl Response
impl Response
pub fn new(status: u16) -> Response
pub fn empty() -> Response
pub fn text(status: u16, text: impl Into<String>) -> Response
pub fn bytes(status: u16, bytes: impl Into<Vec<u8>>) -> Response
pub fn stream(status: u16, stream: impl ResponseStream + 'static) -> Response
pub fn status(&self) -> u16
pub fn content_type(&self) -> Option<&str>
pub fn body(&self) -> &[u8] ⓘ
pub fn is_streaming(&self) -> bool
pub fn headers(&mut self) -> &mut Headers
pub fn into_parts(self) -> (u16, Headers, ResponseBody)
Trait Implementations§
Source§impl IntoResponse for Response
impl IntoResponse for Response
fn into_response(self) -> Response
Auto Trait Implementations§
impl !RefUnwindSafe for Response
impl !Send for Response
impl !Sync for Response
impl !UnwindSafe for Response
impl Freeze for Response
impl Unpin for Response
impl UnsafeUnpin 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