pub trait PluginConnection: Plugin {
// Required methods
fn create(&self, key: &ConnectionKey) -> Box<dyn PluginConnection>;
fn open<'life0, 'life1, 'async_trait>(
&'life0 mut self,
params: &'life1 ResolvedConnectionParams,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn close(&mut self) -> ConnectionKey;
fn is_alive(&self) -> bool;
// Provided methods
fn execute_command<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_command: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn group(&self) -> String { ... }
}Expand description
Manages device connections for plugins that need an explicit session.
Connection plugins provide lifecycle hooks for establishing and tearing down connections and expose a connection operation for downstream use.
Required Methods§
Sourcefn create(&self, key: &ConnectionKey) -> Box<dyn PluginConnection>
fn create(&self, key: &ConnectionKey) -> Box<dyn PluginConnection>
Create a new per-host connection instance.
Sourcefn open<'life0, 'life1, 'async_trait>(
&'life0 mut self,
params: &'life1 ResolvedConnectionParams,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn open<'life0, 'life1, 'async_trait>(
&'life0 mut self,
params: &'life1 ResolvedConnectionParams,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Open a connection to a device.
Sourcefn close(&mut self) -> ConnectionKey
fn close(&mut self) -> ConnectionKey
Close a connection to a device.
Provided Methods§
fn execute_command<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_command: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".