@@ -233,12 +233,6 @@ impl Client {
233
233
Self :: connector ( ) . connect ( cluster) . await
234
234
}
235
235
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
-
242
236
/// Creates a builder with configurable options in connecting to ZooKeeper cluster.
243
237
pub fn connector ( ) -> Connector {
244
238
Connector :: new ( )
@@ -435,8 +429,8 @@ impl Client {
435
429
/// * [Error::InvalidAcl] if acl is invalid or empty.
436
430
///
437
431
/// # 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][].
440
434
///
441
435
/// [ZOOKEEPER-1297]: https://issues.apache.org/jira/browse/ZOOKEEPER-1297
442
436
pub fn create < ' a : ' f , ' b : ' f , ' f > (
@@ -1713,75 +1707,6 @@ impl Connector {
1713
1707
}
1714
1708
}
1715
1709
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
-
1785
1710
trait MultiBuffer {
1786
1711
fn buffer ( & mut self ) -> & mut Vec < u8 > ;
1787
1712
0 commit comments