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 ;
@@ -137,6 +138,19 @@ impl Batch {
137138 self . config . timestamp
138139 }
139140
141+ /// Sets the client-side timeout for this batch.
142+ /// If not None, the driver will stop waiting for the request
143+ /// to finish after `timeout` passed.
144+ /// Otherwise, execution profile timeout will be applied.
145+ pub fn set_request_timeout ( & mut self , timeout : Option < Duration > ) {
146+ self . config . request_timeout = timeout
147+ }
148+
149+ /// Gets client timeout associated with this batch.
150+ pub fn get_request_timeout ( & self ) -> Option < Duration > {
151+ self . config . request_timeout
152+ }
153+
140154 /// Set the retry policy for this batch, overriding the one from execution profile if not None.
141155 #[ inline]
142156 pub fn set_retry_policy ( & mut self , retry_policy : Option < Arc < dyn RetryPolicy > > ) {
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ impl PreparedStatement {
393393 /// Sets the client-side timeout for this statement.
394394 /// If not None, the driver will stop waiting for the request
395395 /// to finish after `timeout` passed.
396- /// Otherwise, default session client timeout will be applied.
396+ /// Otherwise, execution profile timeout will be applied.
397397 pub fn set_request_timeout ( & mut self , timeout : Option < Duration > ) {
398398 self . config . request_timeout = timeout
399399 }
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ impl Statement {
134134 /// Sets the client-side timeout for this statement.
135135 /// If not None, the driver will stop waiting for the request
136136 /// to finish after `timeout` passed.
137- /// Otherwise, default session client timeout will be applied.
137+ /// Otherwise, execution profile timeout will be applied.
138138 pub fn set_request_timeout ( & mut self , timeout : Option < Duration > ) {
139139 self . config . request_timeout = timeout
140140 }
You can’t perform that action at this time.
0 commit comments