Expand description
zookeeper-client
is an async Rust client library for Apache ZooKeeper.
§Opinionated API
This library is written from scratch. Its API is pretty different from Java counterpart or even other Rust clients. Some of them are listed here for a glance.
- No callbacks.
- No catch-all watcher.
- StateWatcher tracks session state updates.
- OneshotWatcher tracks oneshot ZooKeeper node event.
- PersistentWatcher tracks persistent and recursive persistent ZooKeeper node events.
- No event type
XyzWatchRemoved
as Rust has Drop. - Most data operations are ordered at future creation time but not polling time.
- Client::chroot and Client::clone enable session sharing cross multiple different rooted clients.
§Feature flags
tls
: Toggle TLS support.sasl
: Toggle SASL support.sasl-gssapi
: Toggle only GSSAPI SASL support. This relies on binding packagelibgssapi-sys
.sasl-digest-md5
: Toggle only DIGEST-MD5 SASL support.
§Async runtime support
This library uses asyncs and spawns to spawn asynchronous tasks. It exposes runtime feature flags for handy. Please refer their docs for references.
tokio
: Toggle support for tokio.smol
: Toggle support for smol builtin global executor.async-global-executor
: Toggle support for async-global-executor.
Structs§
- Acl expresses node permission for node accessors.
- List of Acls to carry different permissions for different auth identities.
- AuthId represents authenticated identity and expresses authentication requirement in Acl.
- AuthUser represents display info for authenticated identity.
- Similar to MultiWriter expect for CheckWriter::commit.
- Client encapsulates ZooKeeper session to interact with ZooKeeper cluster.
- Builder for Client with more options than Client::connect.
- A builder for Client with more options than Client::connect.
- Options for node creation, constructed from CreateMode::with_acls.
- Thin wrapper to encapsulate sequential node’s sequence number.
- DIGEST-MD5 SASL options.
- GSSAPI SASL options.
- Guard client writes by owned ZooKeeper lock path which will be deleted in background when dropped.
- Options to cover Acls for lock path and CreateOptions for ancestor nodes if they don’t exist.
- Prefix pattern for lock path creation.
- MultiReader commits multiple read operations in one request to achieve snapshot like semantics.
- MultiWriter commits write and condition check operations in one request to achieve transaction like semantics.
- Watcher for stat, data and child event.
- Owned version of LockClient.
- Permission expresses rights accessors should have to operate on attached node.
- Watcher for persistent and recursive watch.
- Client side SASL options.
- Thin wrapper for zookeeper session id. It prints in hex format headed with 0x.
- ZooKeeper session info.
- ZooKeeper node stat.
- StateWatcher tracks session state updates.
- Options for tls connection.
- WatchedEvent represents update to watched node or session.
Enums§
- Watch mode.
- Error for CheckWriter::commit.
- CreateMode specifies ZooKeeper znode type. It covers all znode types with help from CreateOptions::with_ttl.
- EnsembleUpdate specifies an update to ZooKeeper ensemble membership.
- Errors for ZooKeeper operations.
- Event type for watch notifications.
- Individual result for one operation in MultiReader.
- Error for MultiWriter::commit.
- Individual result for one operation in MultiWriter.
- ZooKeeper session states.