pub struct ConnectionManager { /* private fields */ }Expand description
Manages KMIP TCP + TLS connection creation.
Uses the r2d2 crate to manage a pool of connections.
Implementations§
Source§impl ConnectionManagerwhere
Self: ManageConnection,
impl ConnectionManagerwhere
Self: ManageConnection,
Sourcepub fn create_connection_pool(
server_id: String,
conn_settings: Arc<ConnectionSettings>,
max_conncurrent_connections: u32,
max_life_time: Option<Duration>,
max_idle_time: Option<Duration>,
) -> Result<ConnPool, KmipConnError>
pub fn create_connection_pool( server_id: String, conn_settings: Arc<ConnectionSettings>, max_conncurrent_connections: u32, max_life_time: Option<Duration>, max_idle_time: Option<Duration>, ) -> Result<ConnPool, KmipConnError>
Create a pool of up-to N TCP + TLS connections to the KMIP server.
Sourcepub fn connect_one_off(settings: &ConnectionSettings) -> NetResult<Client>
pub fn connect_one_off(settings: &ConnectionSettings) -> NetResult<Client>
Connect using the given connection settings to a KMIP server.
This function creates a new connection to the server. The connection is NOT taken from the connection pool.
Trait Implementations§
Source§impl Debug for ConnectionManager
impl Debug for ConnectionManager
Source§impl ManageConnection for ConnectionManager
impl ManageConnection for ConnectionManager
Source§fn connect(&self) -> Result<Self::Connection, Self::Error>
fn connect(&self) -> Result<Self::Connection, Self::Error>
Establishes a KMIP server connection which will be added to the connection pool.
Source§fn is_valid(&self, _conn: &mut Self::Connection) -> Result<(), Self::Error>
fn is_valid(&self, _conn: &mut Self::Connection) -> Result<(), Self::Error>
This function is never used because the r2d2 test_on_check_out
flag is set to false when the connection pool is created.
Source§fn has_broken(&self, conn: &mut Self::Connection) -> bool
fn has_broken(&self, conn: &mut Self::Connection) -> bool
Quickly verify if an existing connection is broken.
Used to discard and re-create connections that encounter multiple connection related errors.
Source§type Connection = Client<TcpStream>
type Connection = Client<TcpStream>
The connection type this manager deals with.
Auto Trait Implementations§
impl Forget for ConnectionManager
impl Freeze for ConnectionManager
impl RefUnwindSafe for ConnectionManager
impl Send for ConnectionManager
impl Sync for ConnectionManager
impl Unpin for ConnectionManager
impl UnsafeUnpin for ConnectionManager
impl UnwindSafe for ConnectionManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more