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§
Sourcefn try_construct(
&self,
definition: &AttributeDefinition,
value: &Value,
) -> Option<ValidationResult<Box<dyn ValueObject>>>
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
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get a description of what this constructor handles