Trait aragog::New

source ·
pub trait New<T>: Sized {
    // Required method
    fn new(form: T) -> Result<Self, Error>;
}
Expand description

The New trait of the Aragog library. This trait provides the possibility to initialize a Type from an other one. Its main use it to transform a Http form into a Record model instance.

Required Methods§

source

fn new(form: T) -> Result<Self, Error>

Instantiate and returns a new Self instance from T.

Errors

Can fail and return an error, the error is in most of the cases an Error::ValidationError on fields validation failure

Object Safety§

This trait is not object safe.

Implementors§