@@ -73,35 +73,35 @@ impl Default for PubOptions {
7373
7474impl PubOptions {
7575 /// Sets the maximum number of concurrent clients.
76- pub fn max_clients ( mut self , max_clients : usize ) -> Self {
76+ pub fn with_max_clients ( mut self , max_clients : usize ) -> Self {
7777 self . max_clients = Some ( max_clients) ;
7878 self
7979 }
8080
8181 /// Sets the session channel buffer size. This is the amount of messages that can be buffered
8282 /// per session before messages start being dropped.
83- pub fn session_buffer_size ( mut self , session_buffer_size : usize ) -> Self {
83+ pub fn with_session_buffer_size ( mut self , session_buffer_size : usize ) -> Self {
8484 self . session_buffer_size = session_buffer_size;
8585 self
8686 }
8787
8888 /// Sets the maximum number of bytes that can be buffered in the session before being flushed.
8989 /// This internally sets [`Framed::set_backpressure_boundary`](tokio_util::codec::Framed).
90- pub fn backpressure_boundary ( mut self , backpressure_boundary : usize ) -> Self {
90+ pub fn with_backpressure_boundary ( mut self , backpressure_boundary : usize ) -> Self {
9191 self . backpressure_boundary = backpressure_boundary;
9292 self
9393 }
9494
9595 /// Sets the interval at which each session should be flushed. If this is `None`,
9696 /// the session will be flushed on every publish, which can add a lot of overhead.
97- pub fn flush_interval ( mut self , flush_interval : std:: time:: Duration ) -> Self {
97+ pub fn with_flush_interval ( mut self , flush_interval : std:: time:: Duration ) -> Self {
9898 self . flush_interval = Some ( flush_interval) ;
9999 self
100100 }
101101
102102 /// Sets the minimum payload size in bytes for compression to be used. If the payload is smaller
103103 /// than this threshold, it will not be compressed.
104- pub fn min_compress_size ( mut self , min_compress_size : usize ) -> Self {
104+ pub fn with_min_compress_size ( mut self , min_compress_size : usize ) -> Self {
105105 self . min_compress_size = min_compress_size;
106106 self
107107 }
@@ -224,7 +224,7 @@ mod tests {
224224
225225 let mut sub_socket = SubSocket :: with_options (
226226 Tcp :: default ( ) ,
227- SubOptions :: default ( ) . auth_token ( Bytes :: from ( "client1" ) ) ,
227+ SubOptions :: default ( ) . with_auth_token ( Bytes :: from ( "client1" ) ) ,
228228 ) ;
229229
230230 pub_socket. bind ( "0.0.0.0:0" ) . await . unwrap ( ) ;
@@ -250,7 +250,7 @@ mod tests {
250250
251251 let mut sub_socket = SubSocket :: with_options (
252252 Quic :: default ( ) ,
253- SubOptions :: default ( ) . auth_token ( Bytes :: from ( "client1" ) ) ,
253+ SubOptions :: default ( ) . with_auth_token ( Bytes :: from ( "client1" ) ) ,
254254 ) ;
255255
256256 pub_socket. bind ( "0.0.0.0:0" ) . await . unwrap ( ) ;
@@ -389,7 +389,7 @@ mod tests {
389389 let _ = tracing_subscriber:: fmt:: try_init ( ) ;
390390
391391 let mut pub_socket =
392- PubSocket :: with_options ( Tcp :: default ( ) , PubOptions :: default ( ) . max_clients ( 1 ) ) ;
392+ PubSocket :: with_options ( Tcp :: default ( ) , PubOptions :: default ( ) . with_max_clients ( 1 ) ) ;
393393
394394 pub_socket. bind ( "0.0.0.0:0" ) . await . unwrap ( ) ;
395395
0 commit comments