scir::schema

Trait FromSchema

Source
pub trait FromSchema<S: Schema + ?Sized>: Schema {
    type Error;

    // Required methods
    fn convert_primitive(
        primitive: <S as Schema>::Primitive,
    ) -> Result<<Self as Schema>::Primitive, Self::Error>;
    fn convert_instance(
        instance: &mut Instance,
        primitive: &<S as Schema>::Primitive,
    ) -> Result<(), Self::Error>;
}
Expand description

A schema that can be converted from another schema.

Required Associated Types§

Source

type Error

The conversion error type.

Required Methods§

Source

fn convert_primitive( primitive: <S as Schema>::Primitive, ) -> Result<<Self as Schema>::Primitive, Self::Error>

Converts a primitive of the other schema to a primitive of this schema.

Source

fn convert_instance( instance: &mut Instance, primitive: &<S as Schema>::Primitive, ) -> Result<(), Self::Error>

Converts an instance from the other schema to a new instance based on its associated primitive.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§