pub struct ApiResponse<'a, T> {
pub status: Option<ApiStatus>,
pub message: Option<&'a str>,
pub data: Option<T>,
}
Expand description
The basic Fundamentum API response scheme.
Fields§
§status: Option<ApiStatus>
The response status
message: Option<&'a str>
The error message
data: Option<T>
The successful response’s data or some errors. For responses with errors,
see ApiResponseFailedData
and ApiResponseFailedEmpty
structures.
Trait Implementations§
Source§impl<'de: 'a, 'a, T> Deserialize<'de> for ApiResponse<'a, T>where
T: Deserialize<'de>,
impl<'de: 'a, 'a, T> Deserialize<'de> for ApiResponse<'a, T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, T> Format for ApiResponse<'a, T>
impl<'a, T> Format for ApiResponse<'a, T>
Source§impl<'a, T: Deserialize<'a>> From<ApiResponseFailedData<'a>> for ApiResponse<'a, T>
impl<'a, T: Deserialize<'a>> From<ApiResponseFailedData<'a>> for ApiResponse<'a, T>
Source§fn from(response: ApiResponseFailedData<'a>) -> Self
fn from(response: ApiResponseFailedData<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a, T: Deserialize<'a>> From<ApiResponseFailedEmpty<'a>> for ApiResponse<'a, T>
impl<'a, T: Deserialize<'a>> From<ApiResponseFailedEmpty<'a>> for ApiResponse<'a, T>
Source§fn from(response: ApiResponseFailedEmpty<'a>) -> Self
fn from(response: ApiResponseFailedEmpty<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a, T> Freeze for ApiResponse<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for ApiResponse<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ApiResponse<'a, T>where
T: Send,
impl<'a, T> Sync for ApiResponse<'a, T>where
T: Sync,
impl<'a, T> Unpin for ApiResponse<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for ApiResponse<'a, T>where
T: UnwindSafe,
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