Skip to main content

FieldSource

Trait FieldSource 

Source
pub trait FieldSource {
    // Required methods
    fn next(&mut self, out: &mut dyn Any) -> Result<(), ModelError>;
    fn read(&mut self, value: &mut dyn Any) -> Result<(), ModelError>;
}
Expand description

Where a record being built takes its fields from, one after the other.

Required Methods§

Source

fn next(&mut self, out: &mut dyn Any) -> Result<(), ModelError>

The next field’s value, put into out, an Option of its type.

Source

fn read(&mut self, value: &mut dyn Any) -> Result<(), ModelError>

The field just read: read all of it (#[model(whole)]) and move on.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§