zookeeper_client/lib.rs
1//! `zookeeper-client` is an async Rust client library for Apache ZooKeeper.
2//!
3//! ## Opinionated API
4//! This library is written from scratch. Its API is pretty different from Java counterpart or even
5//! other Rust clients. Some of them are listed here for a glance.
6//!
7//! * No callbacks.
8//! * No catch-all watcher.
9//! * [StateWatcher] tracks session state updates.
10//! * [OneshotWatcher] tracks oneshot ZooKeeper node event.
11//! * [PersistentWatcher] tracks persistent and recursive persistent ZooKeeper node events.
12//! * No event type `XyzWatchRemoved` as Rust has [Drop].
13//! * Most data operations are ordered at future creation time but not polling time.
14//! * [Client::chroot] and [Client::clone] enable session sharing cross multiple different rooted clients.
15//!
16//! ## Feature flags
17//! * `tls`: Toggle TLS support.
18//! * `sasl`: Toggle SASL support.
19//! * `sasl-gssapi`: Toggle only GSSAPI SASL support. This relies on binding package `libgssapi-sys`.
20//! * `sasl-digest-md5`: Toggle only DIGEST-MD5 SASL support.
21//!
22//! ## Async runtime support
23//! This library uses [asyncs](https://docs.rs/asyncs) and [spawns](https://docs.rs/spawns) to
24//! spawn asynchronous tasks. It exposes runtime feature flags for handy. Please refer their docs
25//! for references.
26//! * `tokio`: Toggle support for [tokio](https://docs.rs/tokio).
27//! * `smol`: Toggle support for [smol](https://docs.rs/smol) builtin global executor.
28//! * `async-global-executor`: Toggle support for [async-global-executor](https://docs.rs/async-global-executor).
29
30mod acl;
31mod chroot;
32mod client;
33mod deadline;
34mod endpoint;
35mod error;
36mod proto;
37mod record;
38#[cfg(any(feature = "sasl-digest-md5", feature = "sasl-gssapi"))]
39mod sasl;
40mod session;
41#[cfg(feature = "tls")]
42mod tls;
43mod util;
44
45pub use self::acl::{Acl, Acls, AuthId, AuthUser, Permission};
46pub use self::error::Error;
47#[cfg(feature = "tls")]
48pub use self::tls::TlsOptions;
49pub use crate::client::*;
50#[cfg(feature = "sasl-digest-md5")]
51pub use crate::sasl::DigestMd5SaslOptions;
52#[cfg(feature = "sasl-gssapi")]
53pub use crate::sasl::GssapiSaslOptions;
54#[cfg(any(feature = "sasl-digest-md5", feature = "sasl-gssapi"))]
55pub use crate::sasl::SaslOptions;