Converter

Trait Converter 

Source
pub trait Converter:
    Debug
    + Clone
    + Sized
    + Send
    + Sync
    + 'static {
    type OpenApiType: ToOpenApi + Debug + Send + Sync;
    type TargetType: Display + Debug + Send + Sync;

    // Required methods
    fn convert(
        &self,
        src: Self::OpenApiType,
    ) -> Result<Output<Self::TargetType>>;
    fn format_code(&self, path: &Path) -> Result<String>;
}
Expand description

Convert OpenAPI definitions to target type.

Required Associated Types§

Source

type OpenApiType: ToOpenApi + Debug + Send + Sync

The OpenAPI type that this definition converts from.

Source

type TargetType: Display + Debug + Send + Sync

The target type that this definition converts to.

Required Methods§

Source

fn convert(&self, src: Self::OpenApiType) -> Result<Output<Self::TargetType>>

Convert the given OpenAPI type to the target type.

Source

fn format_code(&self, path: &Path) -> Result<String>

Format the code in the given path.

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§