Skip to content

Commit 8ef208d

Browse files
authored
Drop deprecated Client::builder (#63)
It is deprecated since 0.7.0.
1 parent 48dfc3a commit 8ef208d

File tree

1 file changed

+2
-77
lines changed

1 file changed

+2
-77
lines changed

src/client/mod.rs

Lines changed: 2 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,6 @@ impl Client {
233233
Self::connector().connect(cluster).await
234234
}
235235

236-
/// Creates a builder with configurable options in connecting to ZooKeeper cluster.
237-
#[deprecated(since = "0.7.0", note = "use Client::connector instead")]
238-
pub fn builder() -> ClientBuilder {
239-
ClientBuilder::new()
240-
}
241-
242236
/// Creates a builder with configurable options in connecting to ZooKeeper cluster.
243237
pub fn connector() -> Connector {
244238
Connector::new()
@@ -435,8 +429,8 @@ impl Client {
435429
/// * [Error::InvalidAcl] if acl is invalid or empty.
436430
///
437431
/// # Notable behaviors
438-
/// The resulting [Stat] will be [Stat::is_invalid] if assumed server version is 3.4 series or
439-
/// below. See [ClientBuilder::assume_server_version] and [ZOOKEEPER-1297][].
432+
/// The resulting [Stat] will be [Stat::is_invalid] if server version is 3.4 series or
433+
/// below. See [Connector::server_version] and [ZOOKEEPER-1297][].
440434
///
441435
/// [ZOOKEEPER-1297]: https://issues.apache.org/jira/browse/ZOOKEEPER-1297
442436
pub fn create<'a: 'f, 'b: 'f, 'f>(
@@ -1713,75 +1707,6 @@ impl Connector {
17131707
}
17141708
}
17151709

1716-
/// Builder for [Client] with more options than [Client::connect].
1717-
#[derive(Clone, Debug)]
1718-
pub struct ClientBuilder {
1719-
connector: Connector,
1720-
}
1721-
1722-
impl ClientBuilder {
1723-
fn new() -> Self {
1724-
Self { connector: Connector::new() }
1725-
}
1726-
1727-
/// Specifies target session timeout to negotiate with ZooKeeper server.
1728-
///
1729-
/// Defaults to 6s.
1730-
pub fn with_session_timeout(&mut self, timeout: Duration) -> &mut Self {
1731-
self.connector.session_timeout(timeout);
1732-
self
1733-
}
1734-
1735-
/// Specifies idle timeout to conclude a connection as loss.
1736-
///
1737-
/// Defaults to `2/5` of session timeout.
1738-
pub fn with_connection_timeout(&mut self, timeout: Duration) -> &mut Self {
1739-
self.connector.connection_timeout(timeout);
1740-
self
1741-
}
1742-
1743-
/// Specifies whether readonly session is allowed.
1744-
pub fn with_readonly(&mut self, readonly: bool) -> &mut ClientBuilder {
1745-
self.connector.readonly = readonly;
1746-
self
1747-
}
1748-
1749-
/// Specifies auth info for given authentication scheme.
1750-
pub fn with_auth(&mut self, scheme: String, auth: Vec<u8>) -> &mut ClientBuilder {
1751-
self.connector.auth(scheme, auth);
1752-
self
1753-
}
1754-
1755-
/// Specifies client assumed server version of ZooKeeper cluster.
1756-
///
1757-
/// Client will issue server compatible protocol to avoid [Error::Unimplemented] for some
1758-
/// operations. See [Client::create] for an example.
1759-
///
1760-
/// See [ZOOKEEPER-1381][] and [ZOOKEEPER-3762][] for references.
1761-
///
1762-
/// [ZOOKEEPER-1381]: https://issues.apache.org/jira/browse/ZOOKEEPER-1381
1763-
/// [ZOOKEEPER-3762]: https://issues.apache.org/jira/browse/ZOOKEEPER-3762
1764-
pub fn assume_server_version(&mut self, major: u32, minor: u32, patch: u32) -> &mut Self {
1765-
self.connector.server_version(major, minor, patch);
1766-
self
1767-
}
1768-
1769-
/// Detaches creating session so it will not be closed after all client instances dropped.
1770-
pub fn detach(&mut self) -> &mut Self {
1771-
self.connector.detached();
1772-
self
1773-
}
1774-
1775-
/// Connects to ZooKeeper cluster.
1776-
///
1777-
/// # Notable errors
1778-
/// * [Error::NoHosts] if no host is available
1779-
/// * [Error::SessionExpired] if specified session expired
1780-
pub async fn connect(&mut self, cluster: &str) -> Result<Client> {
1781-
self.connector.connect(cluster).await
1782-
}
1783-
}
1784-
17851710
trait MultiBuffer {
17861711
fn buffer(&mut self) -> &mut Vec<u8>;
17871712

0 commit comments

Comments
 (0)