pub trait TransportFactory:
'static
+ Send
+ Sync
+ Debug {
// Required methods
fn default_config(&self, config: &mut Config) -> K2Result<()>;
fn validate_config(&self, config: &Config) -> K2Result<()>;
fn create(
&self,
builder: Arc<Builder>,
handler: DynTxHandler,
) -> BoxFut<'static, K2Result<DynTransport>>;
}Expand description
A factory for constructing Transport instances.
Required Methods§
Sourcefn default_config(&self, config: &mut Config) -> K2Result<()>
fn default_config(&self, config: &mut Config) -> K2Result<()>
Help the builder construct a default config from the chosen module factories.
Sourcefn validate_config(&self, config: &Config) -> K2Result<()>
fn validate_config(&self, config: &Config) -> K2Result<()>
Validate configuration.
The implementation should check only for values which are set and mandatory at first, while missing values that can be provided later, such as during space creation, should be ignored.
Sourcefn create(
&self,
builder: Arc<Builder>,
handler: DynTxHandler,
) -> BoxFut<'static, K2Result<DynTransport>>
fn create( &self, builder: Arc<Builder>, handler: DynTxHandler, ) -> BoxFut<'static, K2Result<DynTransport>>
Construct a transport instance.