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§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get protocol description
Sourcefn default_port(&self) -> Option<u16>
fn default_port(&self) -> Option<u16>
Get default port
Sourcefn 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 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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn config_type_name(&self) -> &str
fn config_type_name(&self) -> &str
Supported configuration type name