ClientGeneratorPlugin

Trait ClientGeneratorPlugin 

Source
pub trait ClientGeneratorPlugin {
    // Required methods
    fn framework_name(&self) -> &str;
    fn supported_extensions(&self) -> Vec<&str>;
    fn generate_client<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        spec: &'life1 OpenApiSpec,
        config: &'life2 ClientGeneratorConfig,
    ) -> Pin<Box<dyn Future<Output = Result<ClientGenerationResult, PluginError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn get_metadata<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = PluginMetadata> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn validate_config<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _config: &'life1 ClientGeneratorConfig,
    ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: Sync + 'async_trait { ... }
}
Expand description

Client generator plugin trait for generating framework-specific mock clients

Required Methods§

Source

fn framework_name(&self) -> &str

Get the framework name this plugin supports

Source

fn supported_extensions(&self) -> Vec<&str>

Get the supported file extensions for this framework

Source

fn generate_client<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, spec: &'life1 OpenApiSpec, config: &'life2 ClientGeneratorConfig, ) -> Pin<Box<dyn Future<Output = Result<ClientGenerationResult, PluginError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Generate mock client code from OpenAPI specification

Source

fn get_metadata<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = PluginMetadata> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get plugin metadata

Provided Methods§

Source

fn validate_config<'life0, 'life1, 'async_trait>( &'life0 self, _config: &'life1 ClientGeneratorConfig, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Validate the plugin configuration

Implementors§