pub struct FieldItem {
pub field: Option<Field>,
pub name: Cow<'static, str>,
pub flattened: bool,
}Expand description
A field item with runtime state for serialization.
This wraps a static Field with additional runtime state that can be modified
during iteration (e.g., for flattened enums where the field name becomes the variant name,
or for flattened maps where entries become synthetic fields).
Fields§
§field: Option<Field>The underlying static field definition (None for flattened map entries)
name: Cow<'static, str>Runtime-determined name (may differ from field.name for flattened enums/maps)
flattened: boolWhether this field was flattened from an enum (variant name used as key)
Implementations§
Source§impl FieldItem
impl FieldItem
Sourcepub fn flattened_enum(field: Field, variant_name: &'static str) -> Self
pub fn flattened_enum(field: Field, variant_name: &'static str) -> Self
Create a flattened enum field item with a custom name (the variant name)
Sourcepub fn flattened_map_entry(key: String) -> Self
pub fn flattened_map_entry(key: String) -> Self
Create a flattened map entry field item with a dynamic key
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FieldItem
impl RefUnwindSafe for FieldItem
impl Send for FieldItem
impl Sync for FieldItem
impl Unpin for FieldItem
impl UnwindSafe for FieldItem
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