SpecifyCreatableStruct

Trait SpecifyCreatableStruct 

Source
pub trait SpecifyCreatableStruct: Sized {
    type InnerIteratorType;
    type Error;

    // Required method
    fn create_struct(
        seed_iterator: &mut dyn Iterator<Item = NamedField<Self::InnerIteratorType>>,
    ) -> Result<Self, Self::Error>;
}
Expand description

Any type implementing this trait must be convertable from an Iterator over elements of type NamedField<I>, where I is the same type assigned to InnerIteratorType.

Required Associated Types§

Source

type InnerIteratorType

The type contained in NamedField

Source

type Error

The type that should be returned if the conversion fails

Required Methods§

Source

fn create_struct( seed_iterator: &mut dyn Iterator<Item = NamedField<Self::InnerIteratorType>>, ) -> Result<Self, Self::Error>

The function that should be called to attempt a conversion from an Iterator to the type implementing this trait.

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.

Implementors§