pub trait FromFlattened<'de>: Sized {
type Partial;
// Required methods
fn init() -> Self::Partial;
fn insert(
ctx: &mut Context<'de>,
key: &Key<'de>,
item: &Item<'de>,
partial: &mut Self::Partial,
) -> Result<(), Failed>;
fn finish(
ctx: &mut Context<'de>,
parent: &Table<'de>,
partial: Self::Partial,
) -> Result<Self, Failed>;
}Available on crate feature
from-toml only.Expand description
Trait for types that can be constructed from flattened TOML table entries.
Used with #[toml(flatten)] on struct fields. Built-in implementations
cover HashMap and BTreeMap.
If your type implements FromToml, use
#[toml(flatten, with = flatten_any)] in your derive instead of
implementing this trait. See helper::flatten_any.
Required Associated Types§
Required Methods§
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.