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§
Sourcefn framework_name(&self) -> &str
fn framework_name(&self) -> &str
Get the framework name this plugin supports
Sourcefn supported_extensions(&self) -> Vec<&str>
fn supported_extensions(&self) -> Vec<&str>
Get the supported file extensions for this framework
Sourcefn 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 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
Sourcefn get_metadata<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PluginMetadata> + Send + 'async_trait>>where
'life0: '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,
Get plugin metadata
Provided Methods§
Sourcefn 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,
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