pub struct PreserveIgnoredFields<T, U> {
pub value: T,
pub ignored_fields: U,
}Expand description
Wrapper to preserve ignored fields.
The wrapped type is stored in the value field.
Ignored fields are stored in the ignored_fields field.
The IgnoredFields type has to implement DeserializeIgnoredFields for this type to implement serde::Deserialize,
and it has to implement SerializeIgnoredFields for this type to implement serde::Serialize.
Be sure the read the main library documentation about the limitations.
If you enable the schemars feature, this type implements the schemars::JsonSchema trait.
The implementation forwards directly to the implementation of T.
Fields§
§value: TThe wrapped value.
ignored_fields: UThe ignored fields.
Implementations§
Source§impl<T, U> PreserveIgnoredFields<T, U>
impl<T, U> PreserveIgnoredFields<T, U>
Sourcepub fn new(value: T, ignored_fields: U) -> Self
pub fn new(value: T, ignored_fields: U) -> Self
Create a new PreserveIgnoredFields struct from a wrapped value and the ignored fields.
Trait Implementations§
Source§impl<T: Clone, U: Clone> Clone for PreserveIgnoredFields<T, U>
impl<T: Clone, U: Clone> Clone for PreserveIgnoredFields<T, U>
Source§fn clone(&self) -> PreserveIgnoredFields<T, U>
fn clone(&self) -> PreserveIgnoredFields<T, U>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Default, U: Default> Default for PreserveIgnoredFields<T, U>
impl<T: Default, U: Default> Default for PreserveIgnoredFields<T, U>
Source§fn default() -> PreserveIgnoredFields<T, U>
fn default() -> PreserveIgnoredFields<T, U>
Source§impl<'de, T, U> Deserialize<'de> for PreserveIgnoredFields<T, U>where
T: Deserialize<'de>,
U: DeserializeIgnoredFields<'de>,
impl<'de, T, U> Deserialize<'de> for PreserveIgnoredFields<T, U>where
T: Deserialize<'de>,
U: DeserializeIgnoredFields<'de>,
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl<T, U: Default> From<T> for PreserveIgnoredFields<T, U>
impl<T, U: Default> From<T> for PreserveIgnoredFields<T, U>
Source§impl<T, IgnoredFields> JsonSchema for PreserveIgnoredFields<T, IgnoredFields>where
T: JsonSchema,
Available on crate feature schemars only.Forwards directly to the schemars::JsonSchema implementation of T.
impl<T, IgnoredFields> JsonSchema for PreserveIgnoredFields<T, IgnoredFields>where
T: JsonSchema,
schemars only.Forwards directly to the schemars::JsonSchema implementation of T.
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more