Trait scir::schema::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.

Object Safety§

This trait is not object safe.

Implementors§