pub struct Response {
pub status: u16,
pub headers: Vec<(String, String)>,
pub body: String,
}Fields§
§status: u16§headers: Vec<(String, String)>§body: StringImplementations§
Source§impl Response
impl Response
pub fn ok(body: impl Into<String>) -> Self
pub fn json(body: impl Into<String>) -> Self
pub fn status(code: u16) -> Self
pub fn not_found() -> Self
pub fn internal_error(msg: impl Into<String>) -> Self
pub fn with_header( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
pub fn body(self, body: impl Into<String>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin 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