pub struct WithOtherFields<T> {
pub inner: T,
pub other: OtherFields,
}
Expand description
An extension to a struct that allows to capture additional fields when deserializing.
See OtherFields
for more information.
Fields§
§inner: T
The inner struct.
other: OtherFields
All fields not present in the inner struct.
Implementations§
Source§impl<T> WithOtherFields<T>
impl<T> WithOtherFields<T>
Sourcepub fn new(inner: T) -> Self
pub fn new(inner: T) -> Self
Creates a new WithOtherFields
instance.
Trait Implementations§
Source§impl<'arbitrary, T: Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for WithOtherFields<T>
impl<'arbitrary, T: Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for WithOtherFields<T>
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured
this type
needs to construct itself. Read moreSource§impl<T, U> AsRef<U> for WithOtherFields<T>where
T: AsRef<U>,
impl<T, U> AsRef<U> for WithOtherFields<T>where
T: AsRef<U>,
Source§impl<T: Clone> Clone for WithOtherFields<T>
impl<T: Clone> Clone for WithOtherFields<T>
Source§fn clone(&self) -> WithOtherFields<T>
fn clone(&self) -> WithOtherFields<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 WithOtherFields<T>
impl<T: Debug> Debug for WithOtherFields<T>
Source§impl<T: Default> Default for WithOtherFields<T>
impl<T: Default> Default for WithOtherFields<T>
Source§fn default() -> WithOtherFields<T>
fn default() -> WithOtherFields<T>
Returns the “default value” for a type. Read more
Source§impl<T> Deref for WithOtherFields<T>
impl<T> Deref for WithOtherFields<T>
Source§impl<T> DerefMut for WithOtherFields<T>
impl<T> DerefMut for WithOtherFields<T>
Source§impl<'de, T> Deserialize<'de> for WithOtherFields<T>where
T: Deserialize<'de> + Serialize,
impl<'de, T> Deserialize<'de> for WithOtherFields<T>where
T: Deserialize<'de> + Serialize,
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: PartialEq> PartialEq for WithOtherFields<T>
impl<T: PartialEq> PartialEq for WithOtherFields<T>
Source§impl<T> Serialize for WithOtherFields<T>where
T: Serialize,
impl<T> Serialize for WithOtherFields<T>where
T: Serialize,
impl<T: Eq> Eq for WithOtherFields<T>
impl<T> StructuralPartialEq for WithOtherFields<T>
Auto Trait Implementations§
impl<T> Freeze for WithOtherFields<T>where
T: Freeze,
impl<T> RefUnwindSafe for WithOtherFields<T>where
T: RefUnwindSafe,
impl<T> Send for WithOtherFields<T>where
T: Send,
impl<T> Sync for WithOtherFields<T>where
T: Sync,
impl<T> Unpin for WithOtherFields<T>where
T: Unpin,
impl<T> UnwindSafe for WithOtherFields<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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)