pub struct ApiResponse {
pub status: u16,
pub headers: Vec<(String, String)>,
pub body: ApiBody,
}Fields§
§status: u16§headers: Vec<(String, String)>§body: ApiBodyImplementations§
Source§impl ApiResponse
impl ApiResponse
pub fn new(status: u16, body: ApiBody) -> Self
pub fn json(status: u16, value: Value) -> Self
pub fn ok(value: Value) -> Self
pub fn created(value: Value) -> Self
pub fn error(err: CoreError) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Trait Implementations§
Source§impl Clone for ApiResponse
impl Clone for ApiResponse
Source§fn clone(&self) -> ApiResponse
fn clone(&self) -> ApiResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiResponse
impl Debug for ApiResponse
Auto Trait Implementations§
impl Freeze for ApiResponse
impl RefUnwindSafe for ApiResponse
impl Send for ApiResponse
impl Sync for ApiResponse
impl Unpin for ApiResponse
impl UnsafeUnpin for ApiResponse
impl UnwindSafe for ApiResponse
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