| Crates.io | deadpool-ldap3 |
| lib.rs | deadpool-ldap3 |
| version | 0.1.1 |
| created_at | 2025-02-24 12:49:58.391126+00 |
| updated_at | 2025-02-24 13:00:08.012827+00 |
| description | Dead simple async pool for ldap |
| homepage | |
| repository | https://github.com/logicin/deadpool-ldap3 |
| max_upload_size | |
| id | 1567427 |
| size | 49,696 |
Deadpool is a dead simple async pool for connections and objects of any type.
This crate implements a deadpool3
manager for ldap3
and provides a wrapper that ensures correct use of the connection
inside a separate thread.
| Feature | Description | Extra dependencies | Default |
|---|---|---|---|
rt_tokio_1 |
Enable support for tokio crate | deadpool/rt_tokio_1 |
yes |
rt_async-std_1 |
Enable support for async-std crate | deadpool/rt_async-std_1 |
no |
serde |
Enable support for serde crate | deadpool/serde, serde/derive |
no |
tracing |
Enable support for tracing by propagating Spans in the interact() calls. Enable this if you use the tracing crate and you want to get useful traces from within interact() calls. |
deadpool-sync/tracing, tracing |
no |
use deadpool_ldap::{Config, Runtime};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let cfg = Config {
url: "ldap://127.0.0.1:389".to_string(),
bind_dn: Some("cn=admin,dc=demo,dc=com".to_string()),
bind_password: Some("123456".to_string()),
pool: None,
};
let pool = cfg.create_pool(Runtime::Tokio1).unwrap();
let mut conn = pool.get().await.unwrap();
conn.simple_bind("admin", "123456").await.unwrap();
Ok(())
}
Licensed under either of
at your option.