Trait HasFields

Source
pub trait HasFields<'mem, 'facet, 'shape> {
    // Required method
    fn fields(&self) -> FieldIter<'mem, 'facet, 'shape> ;

    // Provided method
    fn fields_for_serialize(
        &self,
    ) -> FieldsForSerializeIter<'mem, 'facet, 'shape>  { ... }
}
Expand description

Trait for types that have field methods

This trait allows code to be written generically over both structs and enums that provide field access and iteration capabilities.

Required Methods§

Source

fn fields(&self) -> FieldIter<'mem, 'facet, 'shape>

Iterates over all fields in this type, providing both field metadata and value

Provided Methods§

Source

fn fields_for_serialize(&self) -> FieldsForSerializeIter<'mem, 'facet, 'shape>

Iterates over fields in this type that should be included when it is serialized

Implementors§

Source§

impl<'mem, 'facet, 'shape> HasFields<'mem, 'facet, 'shape> for PeekEnum<'mem, 'facet, 'shape>

Source§

impl<'mem, 'facet, 'shape> HasFields<'mem, 'facet, 'shape> for PeekStruct<'mem, 'facet, 'shape>