pub trait BackendGeneratorPlugin: Send + Sync {
// Required methods
fn backend_type(&self) -> &str;
fn backend_name(&self) -> &str;
fn supported_spec_versions(&self) -> Vec<&str>;
fn supported_extensions(&self) -> Vec<&str>;
fn generate_backend<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
spec: &'life1 OpenApiSpec,
config: &'life2 BackendGeneratorConfig,
) -> Pin<Box<dyn Future<Output = Result<BackendGenerationResult, 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;
fn supports_database(&self, db_type: &str) -> bool;
fn default_port(&self) -> u16;
// Provided method
fn validate_config<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 BackendGeneratorConfig,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
}Expand description
Backend generator plugin trait for generating framework-specific backend servers
Required Methods§
Sourcefn backend_type(&self) -> &str
fn backend_type(&self) -> &str
Get the backend type/framework name this plugin supports
Sourcefn backend_name(&self) -> &str
fn backend_name(&self) -> &str
Get a human-readable name for this backend
Sourcefn supported_spec_versions(&self) -> Vec<&str>
fn supported_spec_versions(&self) -> Vec<&str>
Get the supported OpenAPI spec versions
Sourcefn supported_extensions(&self) -> Vec<&str>
fn supported_extensions(&self) -> Vec<&str>
Get the supported file extensions for generated code
Sourcefn generate_backend<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
spec: &'life1 OpenApiSpec,
config: &'life2 BackendGeneratorConfig,
) -> Pin<Box<dyn Future<Output = Result<BackendGenerationResult, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn generate_backend<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
spec: &'life1 OpenApiSpec,
config: &'life2 BackendGeneratorConfig,
) -> Pin<Box<dyn Future<Output = Result<BackendGenerationResult, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Generate backend server 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
Sourcefn supports_database(&self, db_type: &str) -> bool
fn supports_database(&self, db_type: &str) -> bool
Check if this generator supports the given database type
Sourcefn default_port(&self) -> u16
fn default_port(&self) -> u16
Get default port for this backend type
Provided Methods§
Sourcefn validate_config<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 BackendGeneratorConfig,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn validate_config<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 BackendGeneratorConfig,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Validate the plugin configuration