StructuredDestructure

Trait StructuredDestructure 

Source
pub trait StructuredDestructure {
    // Required methods
    fn destructure_into_components(
        &self,
    ) -> Result<HashMap<String, Box<dyn Any>>>;
    fn extract_field(&self, field_path: &str) -> Result<Box<dyn Any>>;
    fn validate_structure(
        &self,
        schema: &StructuralSchema,
    ) -> Result<ValidationResult>;
}
Expand description

Trait for types that support structured destructuring

Required Methods§

Source

fn destructure_into_components(&self) -> Result<HashMap<String, Box<dyn Any>>>

Destructure into named components

Source

fn extract_field(&self, field_path: &str) -> Result<Box<dyn Any>>

Extract specific fields by path (e.g., “user.address.city”)

Source

fn validate_structure( &self, schema: &StructuralSchema, ) -> Result<ValidationResult>

Validate structure matches expected schema

Implementors§