SerializeIgnoredFields

Trait SerializeIgnoredFields 

Source
pub trait SerializeIgnoredFields {
    type Key: ?Sized + Serialize;
    type Value: ?Sized + Serialize;

    // Required methods
    fn len(&self) -> usize;
    fn iter(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Trait for types that can be used to re-serialize ignored fields.

Required Associated Types§

Source

type Key: ?Sized + Serialize

The type of the key for the ignored fields.

Source

type Value: ?Sized + Serialize

The type of the value of ignored fields.

Required Methods§

Source

fn len(&self) -> usize

The amount of ignored fields.

Source

fn iter(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Iterate over the ignored fields.

Provided Methods§

Source

fn is_empty(&self) -> bool

Check if there are exactly 0 ignored fields.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SerializeIgnoredFields for Map<String, Value>

Available on crate feature serde_json only.
Source§

type Key = String

Source§

type Value = Value

Source§

fn len(&self) -> usize

Source§

fn iter(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Source§

impl SerializeIgnoredFields for Mapping

Available on crate feature serde_yaml only.
Source§

type Key = Value

Source§

type Value = Value

Source§

fn len(&self) -> usize

Source§

fn iter(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Source§

impl SerializeIgnoredFields for Mapping

Available on crate feature serde_yml only.
Source§

type Key = Value

Source§

type Value = Value

Source§

fn len(&self) -> usize

Source§

fn iter(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Source§

impl SerializeIgnoredFields for Table

Available on crate feature serde_toml only.
Source§

type Key = String

Source§

type Value = Value

Source§

fn len(&self) -> usize

Source§

fn iter(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Implementors§