Trait ValueObjectConstructor

Source
pub trait ValueObjectConstructor: Send + Sync {
    // Required methods
    fn try_construct(
        &self,
        definition: &AttributeDefinition,
        value: &Value,
    ) -> Option<ValidationResult<Box<dyn ValueObject>>>;
    fn priority(&self) -> u8;
    fn description(&self) -> &str;
}
Expand description

Trait for value object constructors that can be registered.

Required Methods§

Source

fn try_construct( &self, definition: &AttributeDefinition, value: &Value, ) -> Option<ValidationResult<Box<dyn ValueObject>>>

Attempt to construct a value object from the given definition and value

Source

fn priority(&self) -> u8

Get the priority of this constructor

Source

fn description(&self) -> &str

Get a description of what this constructor handles

Implementors§