pub struct DumpOptions {
pub exclude_none: bool,
pub exclude_defaults: bool,
pub include: Option<FieldSet>,
pub exclude: Option<FieldSet>,
}Expand description
Options controlling serialization output.
Fields§
§exclude_none: boolDrop object members whose value is null.
exclude_defaults: boolDrop fields equal to their declared default (derived models only).
include: Option<FieldSet>Keep only these fields.
exclude: Option<FieldSet>Drop these fields.
Implementations§
Source§impl DumpOptions
impl DumpOptions
Sourcepub fn exclude_none(self) -> Self
pub fn exclude_none(self) -> Self
Drop null members.
Sourcepub fn exclude_defaults(self) -> Self
pub fn exclude_defaults(self) -> Self
Drop fields equal to their default.
Sourcepub fn for_field(&self, field: &str) -> Option<DumpOptions>
pub fn for_field(&self, field: &str) -> Option<DumpOptions>
Options for the member field of an object, or None if the member
is excluded entirely.
Sourcepub fn drops_value(&self, value: &Value) -> bool
pub fn drops_value(&self, value: &Value) -> bool
Whether a member with this value should be dropped by exclude_none.
Trait Implementations§
Source§impl Clone for DumpOptions
impl Clone for DumpOptions
Source§fn clone(&self) -> DumpOptions
fn clone(&self) -> DumpOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DumpOptions
impl Debug for DumpOptions
Source§impl Default for DumpOptions
impl Default for DumpOptions
Source§fn default() -> DumpOptions
fn default() -> DumpOptions
Returns the “default value” for a type. Read more
impl Eq for DumpOptions
Source§impl PartialEq for DumpOptions
impl PartialEq for DumpOptions
impl StructuralPartialEq for DumpOptions
Auto Trait Implementations§
impl Freeze for DumpOptions
impl RefUnwindSafe for DumpOptions
impl Send for DumpOptions
impl Sync for DumpOptions
impl Unpin for DumpOptions
impl UnsafeUnpin for DumpOptions
impl UnwindSafe for DumpOptions
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.