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§
Sourcefn destructure_into_components(&self) -> Result<HashMap<String, Box<dyn Any>>>
fn destructure_into_components(&self) -> Result<HashMap<String, Box<dyn Any>>>
Destructure into named components
Sourcefn extract_field(&self, field_path: &str) -> Result<Box<dyn Any>>
fn extract_field(&self, field_path: &str) -> Result<Box<dyn Any>>
Extract specific fields by path (e.g., “user.address.city”)
Sourcefn validate_structure(
&self,
schema: &StructuralSchema,
) -> Result<ValidationResult>
fn validate_structure( &self, schema: &StructuralSchema, ) -> Result<ValidationResult>
Validate structure matches expected schema