pub trait DynSchema: Send + Sync {
// Required methods
fn validate_value(&self, v: &Value) -> Vec<FormaIssue>;
fn shape(&self) -> &ShapeNode;
fn metadata(&self) -> &FieldMeta;
}Expand description
The object-safe erased view over a Value tree (DV-2).
Both views execute from the same internal representation, so results always
agree with the typed path (SC-9). Usable as Box<dyn DynSchema>.
The Send + Sync supertraits make erased schemas thread-safe and safe to
hold in reactive/memo contexts (Arc<Box<dyn DynSchema>> captured by
shared closures), so introspection can be cached across threads.
Required Methods§
Sourcefn validate_value(&self, v: &Value) -> Vec<FormaIssue>
fn validate_value(&self, v: &Value) -> Vec<FormaIssue>
Validates an erased value; issues mirror what the typed parse would report.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".