pub enum ApiResponse<T> {
Valid(T),
Invalid(InvalidApiResponseError),
}Expand description
A json response from the UserData API.
Variants§
Implementations§
Source§impl<T> ApiResponse<T>
impl<T> ApiResponse<T>
Sourcepub fn into_result(self) -> Result<T, InvalidApiResponseError>
pub fn into_result(self) -> Result<T, InvalidApiResponseError>
Convert this into as Result.
Sourcepub fn take_valid(self) -> Option<T>
pub fn take_valid(self) -> Option<T>
Consume self and return the valid variant, or None.
Sourcepub fn take_invalid(self) -> Option<InvalidApiResponseError>
pub fn take_invalid(self) -> Option<InvalidApiResponseError>
Consume self and return the invalid variant, or None.
Trait Implementations§
Source§impl<T: Debug> Debug for ApiResponse<T>
impl<T: Debug> Debug for ApiResponse<T>
Source§impl<'de, T> Deserialize<'de> for ApiResponse<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ApiResponse<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
Auto Trait Implementations§
impl<T> Freeze for ApiResponse<T>where
T: Freeze,
impl<T> RefUnwindSafe for ApiResponse<T>where
T: RefUnwindSafe,
impl<T> Send for ApiResponse<T>where
T: Send,
impl<T> Sync for ApiResponse<T>where
T: Sync,
impl<T> Unpin for ApiResponse<T>where
T: Unpin,
impl<T> UnwindSafe for ApiResponse<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