pub struct JSONResponse;Expand description
§JSONResponse
Helpful tool for converting a serde_json json string into a response.
It will take in the response code, and create a response string with the headers required.
See the examples for usage
Implementations§
Source§impl JSONResponse
impl JSONResponse
Sourcepub async fn construct_response(response_code: Response, data: String) -> String
pub async fn construct_response(response_code: Response, data: String) -> String
This function takes the response code and data (the json) to write, and returns a string that can be used as a response.
Auto Trait Implementations§
impl Freeze for JSONResponse
impl RefUnwindSafe for JSONResponse
impl Send for JSONResponse
impl Sync for JSONResponse
impl Unpin for JSONResponse
impl UnwindSafe for JSONResponse
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