Skip to main content

IntoSchema

Trait IntoSchema 

Source
pub trait IntoSchema<S>: Sized {
    // Required method
    fn into_schema(self) -> S;
}
Expand description

Converts an application model into a selected schema representation.

The result is a data value in the requested representation. It may be a bare schema value, a version-family value, or a container of schema values. A model may support multiple target representations.

The VersionBoundary derive constructs the latest schema value, then uses From to convert it into S. Requesting its version family selects the latest variant; requesting an older schema requires an explicit conversion from the latest schema. Such conversions may discard information, so a round trip through a schema need not preserve the original model.

Required Methods§

Source

fn into_schema(self) -> S

Converts this model into the requested schema representation.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T, S> IntoSchema<Option<S>> for Option<T>
where T: IntoSchema<S>,

Implementors§