pub struct ResultSchemaValidator;Expand description
Strict result validator that rejects unknown fields
Implementations§
Source§impl ResultSchemaValidator
impl ResultSchemaValidator
Sourcepub fn validate_json(
json_str: &str,
) -> Result<ResultSchemaV1, ResultSchemaError>
pub fn validate_json( json_str: &str, ) -> Result<ResultSchemaV1, ResultSchemaError>
Validate JSON against locked schema v1
This validator REJECTS unknown fields (except in x_meta) to enforce backward compatibility and prevent breaking changes.
Sourcepub fn validate_struct(result: &ResultSchemaV1) -> Result<(), ResultSchemaError>
pub fn validate_struct(result: &ResultSchemaV1) -> Result<(), ResultSchemaError>
Validate a pre-parsed ResultSchemaV1
Sourcepub fn check_backward_compatibility(
_old_result: &ResultSchemaV1,
_new_result: &ResultSchemaV1,
) -> Result<(), ResultSchemaError>
pub fn check_backward_compatibility( _old_result: &ResultSchemaV1, _new_result: &ResultSchemaV1, ) -> Result<(), ResultSchemaError>
Check backward compatibility with previous result
Sourcepub fn schema_hash() -> String
pub fn schema_hash() -> String
Generate schema hash for ABI stability checks
Auto Trait Implementations§
impl Freeze for ResultSchemaValidator
impl RefUnwindSafe for ResultSchemaValidator
impl Send for ResultSchemaValidator
impl Sync for ResultSchemaValidator
impl Unpin for ResultSchemaValidator
impl UnsafeUnpin for ResultSchemaValidator
impl UnwindSafe for ResultSchemaValidator
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