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§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
)