pub trait FromSchema<S>: Schema
where S: Schema + ?Sized,
{ type Error; // Required methods fn convert_primitive( primitive: <S as Schema>::Primitive ) -> Result<Self::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::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§