pub struct StofResponse {
pub headers: HeaderMap,
pub status: StatusCode,
pub str_body: String,
pub bytes_body: Option<Bytes>,
}Expand description
Response object, implementing IntoResonse.
Fields§
§headers: HeaderMap§status: StatusCode§str_body: String§bytes_body: Option<Bytes>Implementations§
Source§impl StofResponse
impl StofResponse
Sourcepub fn val_response(doc: &SDoc, value: SVal) -> Self
pub fn val_response(doc: &SDoc, value: SVal) -> Self
Creates a response from this value with a success status code.
Sourcepub fn error(code: StatusCode, message: &str) -> Self
pub fn error(code: StatusCode, message: &str) -> Self
Error response.
Trait Implementations§
Source§impl IntoResponse for StofResponse
impl IntoResponse for StofResponse
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl !Freeze for StofResponse
impl RefUnwindSafe for StofResponse
impl Send for StofResponse
impl Sync for StofResponse
impl Unpin for StofResponse
impl UnsafeUnpin for StofResponse
impl UnwindSafe for StofResponse
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