pub trait ValueObject:
Debug
+ Send
+ Sync {
// Required methods
fn attribute_type(&self) -> AttributeType;
fn attribute_name(&self) -> &str;
fn to_json(&self) -> ValidationResult<Value>;
fn validate_against_schema(
&self,
definition: &AttributeDefinition,
) -> ValidationResult<()>;
fn as_json_value(&self) -> Value;
fn supports_definition(&self, definition: &AttributeDefinition) -> bool;
fn clone_boxed(&self) -> Box<dyn ValueObject>;
fn as_any(&self) -> &dyn Any;
}Expand description
Core trait for all SCIM value objects.
This trait enables dynamic value object operations while maintaining type safety through the use of Any for downcasting when needed.
Required Methods§
Sourcefn attribute_type(&self) -> AttributeType
fn attribute_type(&self) -> AttributeType
Get the SCIM attribute type this value object represents
Sourcefn attribute_name(&self) -> &str
fn attribute_name(&self) -> &str
Get the schema attribute name this value object corresponds to
Sourcefn to_json(&self) -> ValidationResult<Value>
fn to_json(&self) -> ValidationResult<Value>
Serialize the value object to JSON
Sourcefn validate_against_schema(
&self,
definition: &AttributeDefinition,
) -> ValidationResult<()>
fn validate_against_schema( &self, definition: &AttributeDefinition, ) -> ValidationResult<()>
Validate the value object against a schema definition
Sourcefn as_json_value(&self) -> Value
fn as_json_value(&self) -> Value
Get the raw value as a JSON Value for schema-agnostic operations
Sourcefn supports_definition(&self, definition: &AttributeDefinition) -> bool
fn supports_definition(&self, definition: &AttributeDefinition) -> bool
Check if this value object supports the given attribute definition
Sourcefn clone_boxed(&self) -> Box<dyn ValueObject>
fn clone_boxed(&self) -> Box<dyn ValueObject>
Clone the value object as a boxed trait object