pub struct ValueObjectRegistry { /* private fields */ }Expand description
Registry for value object constructors.
This registry maintains a mapping of attribute types and names to constructor functions, enabling dynamic value object creation.
Implementations§
Source§impl ValueObjectRegistry
impl ValueObjectRegistry
Sourcepub fn register_constructor(
&mut self,
constructor: Box<dyn ValueObjectConstructor>,
)
pub fn register_constructor( &mut self, constructor: Box<dyn ValueObjectConstructor>, )
Register a value object constructor
Sourcepub fn register_composite_validator(
&mut self,
validator: Box<dyn CompositeValidator>,
)
pub fn register_composite_validator( &mut self, validator: Box<dyn CompositeValidator>, )
Register a composite validator
Sourcepub fn create_value_object(
&self,
definition: &AttributeDefinition,
value: &Value,
) -> ValidationResult<Box<dyn ValueObject>>
pub fn create_value_object( &self, definition: &AttributeDefinition, value: &Value, ) -> ValidationResult<Box<dyn ValueObject>>
Create a value object from schema definition and JSON value
Sourcepub fn validate_composite_rules(
&self,
objects: &[Box<dyn ValueObject>],
) -> ValidationResult<()>
pub fn validate_composite_rules( &self, objects: &[Box<dyn ValueObject>], ) -> ValidationResult<()>
Validate composite rules across multiple value objects
Sourcepub fn has_constructors(&self) -> bool
pub fn has_constructors(&self) -> bool
Check if the registry has any constructors registered
Trait Implementations§
Source§impl Default for ValueObjectRegistry
impl Default for ValueObjectRegistry
Source§fn default() -> ValueObjectRegistry
fn default() -> ValueObjectRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValueObjectRegistry
impl !RefUnwindSafe for ValueObjectRegistry
impl !Send for ValueObjectRegistry
impl !Sync for ValueObjectRegistry
impl Unpin for ValueObjectRegistry
impl !UnwindSafe for ValueObjectRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> TenantValidator for T
impl<T> TenantValidator for T
Source§fn validate_tenant_context(
&self,
expected_tenant_id: &str,
context: &RequestContext,
) -> Result<(), String>
fn validate_tenant_context( &self, expected_tenant_id: &str, context: &RequestContext, ) -> Result<(), String>
Validate that the context has the expected tenant.
Source§fn validate_single_tenant_context(
&self,
context: &RequestContext,
) -> Result<(), String>
fn validate_single_tenant_context( &self, context: &RequestContext, ) -> Result<(), String>
Validate that the context is for single-tenant operation.
Source§fn require_tenant_context(&self, context: &RequestContext) -> Result<(), String>
fn require_tenant_context(&self, context: &RequestContext) -> Result<(), String>
Extract tenant context or return error for multi-tenant operations.