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//! * `fips`: Toggle TLS FIPS mode support. See also [TlsOptions::with_fips].
19//! * `fips-only`: Force TLS FIPS mode. This should be considered as an application only feature to
20//! fulfill security requirement at global level.
21//! * `sasl`: Toggle SASL support.
22//! * `sasl-gssapi`: Toggle only GSSAPI SASL support. This relies on binding package `libgssapi-sys`.
23//! * `sasl-digest-md5`: Toggle only DIGEST-MD5 SASL support.
24//!
25//! ## Async runtime support
26//! This library uses [asyncs](https://docs.rs/asyncs) and [spawns](https://docs.rs/spawns) to
27//! spawn asynchronous tasks. It exposes runtime feature flags for handy. Please refer their docs
28//! for references.
29//! * `tokio`: Toggle support for [tokio](https://docs.rs/tokio).
30//! * `smol`: Toggle support for [smol](https://docs.rs/smol) builtin global executor.
31//! * `async-global-executor`: Toggle support for [async-global-executor](https://docs.rs/async-global-executor).
32
33#![cfg_attr(docsrs, feature(doc_cfg))]
34
35mod acl;
36mod chroot;
37mod client;
38mod deadline;
39mod endpoint;
40mod error;
41mod proto;
42mod record;
43#[cfg(any(feature = "sasl-digest-md5", feature = "sasl-gssapi"))]
44mod sasl;
45mod session;
46#[cfg(feature = "tls")]
47mod tls;
48mod util;
49
50pub use self::acl::{Acl, Acls, AuthId, AuthUser, Permission};
51pub use self::error::Error;
52#[cfg(feature = "tls")]
53#[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
54pub use self::tls::{TlsCa, TlsCerts, TlsCertsBuilder, TlsCertsOptions, TlsDynamicCerts, TlsIdentity, TlsOptions};
55pub use crate::client::*;
56#[cfg(feature = "sasl-digest-md5")]
57#[cfg_attr(docsrs, doc(cfg(any(feature = "sasl", feature = "sasl-digest-md5"))))]
58pub use crate::sasl::DigestMd5SaslOptions;
59#[cfg(feature = "sasl-gssapi")]
60#[cfg_attr(docsrs, doc(cfg(any(feature = "sasl", feature = "sasl-gssapi"))))]
61pub use crate::sasl::GssapiSaslOptions;
62#[cfg(any(feature = "sasl-digest-md5", feature = "sasl-gssapi"))]
63#[cfg_attr(docsrs, doc(cfg(any(feature = "sasl", feature = "sasl-gssapi", feature = "sasl-digest-md5"))))]
64pub use crate::sasl::SaslOptions;