pub struct ResultJson<M, N> {
pub ok: Option<M>,
pub err: Option<N>,
}Expand description
A JSON representation of a Result.
Fields§
§ok: Option<M>The OK value.
err: Option<N>The error value.
Trait Implementations§
Source§impl<M: Clone, N: Clone> Clone for ResultJson<M, N>
impl<M: Clone, N: Clone> Clone for ResultJson<M, N>
Source§fn clone(&self) -> ResultJson<M, N>
fn clone(&self) -> ResultJson<M, N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, M, N> Deserialize<'de> for ResultJson<M, N>where
M: Deserialize<'de>,
N: Deserialize<'de>,
impl<'de, M, N> Deserialize<'de> for ResultJson<M, N>where
M: Deserialize<'de>,
N: 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<M: Serialize + DeserializeOwned, N: Serialize + DeserializeOwned, P, Q> Json<ResultJson<M, N>> for Result<P, Q>
impl<M: Serialize + DeserializeOwned, N: Serialize + DeserializeOwned, P, Q> Json<ResultJson<M, N>> for Result<P, Q>
Source§fn to_json(self) -> ResultJson<M, N>
fn to_json(self) -> ResultJson<M, N>
Converts the value to its JSON representation.
Source§fn from_json(json: ResultJson<M, N>) -> Result<Self>
fn from_json(json: ResultJson<M, N>) -> Result<Self>
Converts the value from its JSON representation.
Auto Trait Implementations§
impl<M, N> Freeze for ResultJson<M, N>
impl<M, N> RefUnwindSafe for ResultJson<M, N>where
M: RefUnwindSafe,
N: RefUnwindSafe,
impl<M, N> Send for ResultJson<M, N>
impl<M, N> Sync for ResultJson<M, N>
impl<M, N> Unpin for ResultJson<M, N>
impl<M, N> UnwindSafe for ResultJson<M, N>where
M: UnwindSafe,
N: 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