LDAP client library
A pure-Rust LDAP client library using the Tokio stack.
Interaction with Tokio versions
Version 0.8 of the library has been adapted for Tokio 0.3. If your application needs Tokio 0.2, use version 0.7; there are presently no functional differences between 0.7 and 0.8. At least one further 0.7 release is planned before continuing the development of version 0.8.
Documentation
Note
The library is client-only. One cannot make an LDAP server or a proxy with it.
Usage
The library can be used either synchronously or asynchronously. The aim is to offer essentially the same call interface for both flavors, with the necessary differences in interaction and return values according to the nature of I/O.
Add this to your Cargo.toml
:
[]
= "0.8"
Examples
The following two examples perform exactly the same operation and should produce identical
results. They should be run against the example server in the data
subdirectory of the crate source.
Other sample programs expecting the same server setup can be found in the examples
subdirectory.
Synchronous search
use ;
use Result;
Asynchronous search
use ;
use Result;
async
Compile-time features
The following features are available at compile time:
-
sync (enabled by default): Synchronous API support.
-
tls (enabled by default): TLS support, backed by the
native-tls
crate, which uses a platform-specific TLS backend. This is an alias for tls-native. -
tls-rustls (disabled by default): TLS support, backed by the Rustls library.
Without any features, only plain TCP connections (and Unix domain sockets on Unix-like platforms) are available. For TLS support, tls and tls-rustls are mutually exclusive: choosing both will produce a compile-time error.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE), or
- MIT license (LICENSE-MIT)
at your option.