pub struct LDAPConnectionManager(pub &'static str);
Expand description
An r2d2::ManageConnection
for ldap3::LdapConn
s.
§Example
use std::thread;
use r2d2_ldap::LDAPConnectionManager;
fn main() {
let pool = r2d2::Pool::new(LDAPConnectionManager("ldap://example.org")).unwrap();
for i in 0..10i32 {
let pool = pool.clone();
thread::spawn(move || {
let mut ldap = pool.get().unwrap();
ldap.simple_bind("uid=john,cn=users,dc=example,dc=org", "password").unwrap();
});
}
}
Tuple Fields§
§0: &'static str
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LDAPConnectionManager
impl RefUnwindSafe for LDAPConnectionManager
impl Send for LDAPConnectionManager
impl Sync for LDAPConnectionManager
impl Unpin for LDAPConnectionManager
impl UnwindSafe for LDAPConnectionManager
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