Trait ProtocolPlugin

Source
pub trait ProtocolPlugin: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn features(&self) -> Vec<String>;
    fn default_port(&self) -> Option<u16>;
    fn validate_config<'life0, 'life1, 'async_trait>(
        &'life0 self,
        config: &'life1 dyn Any,
    ) -> Pin<Box<dyn Future<Output = Result<(), ConfigError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_server<'life0, 'async_trait>(
        &'life0 self,
        config: Box<dyn Any>,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Server>, TransportError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create_connection_factory<'life0, 'async_trait>(
        &'life0 self,
        config: Box<dyn Any>,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ConnectionFactory>, TransportError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn config_type_name(&self) -> &str;
}
Expand description

Protocol plugin interface

Required Methods§

Source

fn name(&self) -> &str

Get protocol name

Source

fn description(&self) -> &str

Get protocol description

Source

fn features(&self) -> Vec<String>

Get protocol features

Source

fn default_port(&self) -> Option<u16>

Get default port

Source

fn validate_config<'life0, 'life1, 'async_trait>( &'life0 self, config: &'life1 dyn Any, ) -> Pin<Box<dyn Future<Output = Result<(), ConfigError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate configuration

Source

fn create_server<'life0, 'async_trait>( &'life0 self, config: Box<dyn Any>, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Server>, TransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create server

Source

fn create_connection_factory<'life0, 'async_trait>( &'life0 self, config: Box<dyn Any>, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ConnectionFactory>, TransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create connection factory

Source

fn config_type_name(&self) -> &str

Supported configuration type name

Implementors§