Skip to main content

ObjectChild

Trait ObjectChild 

Source
pub trait ObjectChild:
    Debug
    + Send
    + Sync
    + Sealed {
    // Required methods
    fn validate_at(
        &self,
        v: &Value,
        path: &FieldPath,
        fail_fast: bool,
    ) -> Result<Value, Vec<FormaIssue>>;
    fn shape_node(&self) -> ShapeNode;
    fn meta(&self) -> &FieldMeta;
    fn clone_boxed(&self) -> Box<dyn ObjectChild>;
}
Expand description

Contract for anything that can back an crate::types::object::ObjectSchema field: path-aware validation with a fail-fast override, plus an introspection projection (D3).

Public only so the ObjectSchema::field signature is nameable; sealed, so only the builtin families implement it.

Required Methods§

Source

fn validate_at( &self, v: &Value, path: &FieldPath, fail_fast: bool, ) -> Result<Value, Vec<FormaIssue>>

Validates v addressed at path (already joined by the caller); on full success returns the validated output converted to Value.

Source

fn shape_node(&self) -> ShapeNode

Introspection projection (delegates to the child’s own shape()).

Source

fn meta(&self) -> &FieldMeta

UI-facing metadata slots of the child (serves ObjectSchema::field_meta).

Source

fn clone_boxed(&self) -> Box<dyn ObjectChild>

Crate-internal deep-clone seam powering ObjectSchema: Clone (Field.child is Box<dyn ObjectChild>, which cannot be duplicated without dispatch). Sealed: exactly six impls, all below.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§