pub trait Connection {
// Required methods
fn connect(
&mut self,
url: &str,
options: ConnectionOptions,
) -> Result<(), String>;
fn disconnect(&mut self) -> Result<(), String>;
}
Expand description
Define a common trait for connection management
Required Methods§
Sourcefn connect(
&mut self,
url: &str,
options: ConnectionOptions,
) -> Result<(), String>
fn connect( &mut self, url: &str, options: ConnectionOptions, ) -> Result<(), String>
Connect to a server
Sourcefn disconnect(&mut self) -> Result<(), String>
fn disconnect(&mut self) -> Result<(), String>
Disconnect from the server
Implementors§
impl Connection for Request
Implement the common trait for Request
impl<'a> Connection for Subscribe<'a>
Implement the common trait for Subscribe