pub enum Futureproof<T> {
Understandable(T),
Unknown(JsonValue),
}
Expand description
A wrapper type for types whose representation may change in future versions of Arti.
This uses #[serde(untagged)]
to attempt deserializing as a type T
first, and falls back
to a generic JSON value representation if that fails.
Variants§
Understandable(T)
A successfully-deserialized T
.
Unknown(JsonValue)
A generic JSON value, representing a failure to deserialize a T
.
Implementations§
Source§impl<T> Futureproof<T>
impl<T> Futureproof<T>
Sourcepub fn into_option(self) -> Option<T>
pub fn into_option(self) -> Option<T>
Convert the Futureproof
into an Option<T>
, throwing away an Unknown
value.
Trait Implementations§
Source§impl<T: Clone> Clone for Futureproof<T>
impl<T: Clone> Clone for Futureproof<T>
Source§fn clone(&self) -> Futureproof<T>
fn clone(&self) -> Futureproof<T>
Returns a copy 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<T: Debug> Debug for Futureproof<T>
impl<T: Debug> Debug for Futureproof<T>
Source§impl<'de, T> Deserialize<'de> for Futureproof<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Futureproof<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<T> From<T> for Futureproof<T>
impl<T> From<T> for Futureproof<T>
Source§impl<T: PartialEq> PartialEq for Futureproof<T>
impl<T: PartialEq> PartialEq for Futureproof<T>
Source§impl<T> Serialize for Futureproof<T>where
T: Serialize,
impl<T> Serialize for Futureproof<T>where
T: Serialize,
impl<T: Eq> Eq for Futureproof<T>
impl<T> StructuralPartialEq for Futureproof<T>
Auto Trait Implementations§
impl<T> Freeze for Futureproof<T>where
T: Freeze,
impl<T> RefUnwindSafe for Futureproof<T>where
T: RefUnwindSafe,
impl<T> Send for Futureproof<T>where
T: Send,
impl<T> Sync for Futureproof<T>where
T: Sync,
impl<T> Unpin for Futureproof<T>where
T: Unpin,
impl<T> UnwindSafe for Futureproof<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more