File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 11use std:: borrow:: Cow ;
22use std:: sync:: Arc ;
3+ use std:: time:: Duration ;
34
45use crate :: client:: execution_profile:: ExecutionProfileHandle ;
56use crate :: observability:: history:: HistoryListener ;
@@ -123,6 +124,19 @@ impl Batch {
123124 self . config . timestamp
124125 }
125126
127+ /// Sets the client-side timeout for this batch.
128+ /// If not None, the driver will stop waiting for the request
129+ /// to finish after `timeout` passed.
130+ /// Otherwise, execution profile timeout will be applied.
131+ pub fn set_request_timeout ( & mut self , timeout : Option < Duration > ) {
132+ self . config . request_timeout = timeout
133+ }
134+
135+ /// Gets client timeout associated with this batch.
136+ pub fn get_request_timeout ( & self ) -> Option < Duration > {
137+ self . config . request_timeout
138+ }
139+
126140 /// Set the retry policy for this batch, overriding the one from execution profile if not None.
127141 #[ inline]
128142 pub fn set_retry_policy ( & mut self , retry_policy : Option < Arc < dyn RetryPolicy > > ) {
Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ impl PreparedStatement {
379379 /// Sets the client-side timeout for this statement.
380380 /// If not None, the driver will stop waiting for the request
381381 /// to finish after `timeout` passed.
382- /// Otherwise, default session client timeout will be applied.
382+ /// Otherwise, execution profile timeout will be applied.
383383 pub fn set_request_timeout ( & mut self , timeout : Option < Duration > ) {
384384 self . config . request_timeout = timeout
385385 }
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ impl Statement {
120120 /// Sets the client-side timeout for this statement.
121121 /// If not None, the driver will stop waiting for the request
122122 /// to finish after `timeout` passed.
123- /// Otherwise, default session client timeout will be applied.
123+ /// Otherwise, execution profile timeout will be applied.
124124 pub fn set_request_timeout ( & mut self , timeout : Option < Duration > ) {
125125 self . config . request_timeout = timeout
126126 }
You can’t perform that action at this time.
0 commit comments