pub struct DataOption<T>(pub Option<T>);Expand description
A wrapper around Option for deserializing from optional data from a HTTP response.
The Option must be wrapped in order to implement FromHttpResponse, because the
default implementation for Option where the data is DeserializeOwned would conflict
with the direct implementation for types that are DeserializeOwned themselves.
Tuple Fields§
§0: Option<T>Trait Implementations§
Source§impl<T: Debug> Debug for DataOption<T>
impl<T: Debug> Debug for DataOption<T>
Source§impl<T> From<DataOption<T>> for Option<T>
impl<T> From<DataOption<T>> for Option<T>
Source§fn from(value: DataOption<T>) -> Self
fn from(value: DataOption<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<Option<T>> for DataOption<T>
impl<T> From<Option<T>> for DataOption<T>
Source§impl<D: DeserializeOwned> FromHttpResponse for DataOption<D>
impl<D: DeserializeOwned> FromHttpResponse for DataOption<D>
Auto Trait Implementations§
impl<T> Freeze for DataOption<T>where
T: Freeze,
impl<T> RefUnwindSafe for DataOption<T>where
T: RefUnwindSafe,
impl<T> Send for DataOption<T>where
T: Send,
impl<T> Sync for DataOption<T>where
T: Sync,
impl<T> Unpin for DataOption<T>where
T: Unpin,
impl<T> UnwindSafe for DataOption<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