Skip to content

Commit 07553fe

Browse files
authored
Merge pull request #1104 from muzarski/exec-profile-getters
exec_profile: expose public getters for profile configuration
2 parents 4c96bd4 + f9d554e commit 07553fe

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

scylla/src/transport/execution_profile.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,36 @@ impl ExecutionProfile {
457457
pub fn into_handle_with_label(self, label: String) -> ExecutionProfileHandle {
458458
ExecutionProfileHandle(Arc::new((ArcSwap::new(self.0), Some(label))))
459459
}
460+
461+
/// Gets client timeout associated with this profile.
462+
pub fn get_request_timeout(&self) -> Option<Duration> {
463+
self.0.request_timeout
464+
}
465+
466+
/// Gets consistency associated with this profile.
467+
pub fn get_consistency(&self) -> Consistency {
468+
self.0.consistency
469+
}
470+
471+
/// Gets serial consistency (if set) associated with this profile.
472+
pub fn get_serial_consistency(&self) -> Option<SerialConsistency> {
473+
self.0.serial_consistency
474+
}
475+
476+
/// Gets load balancing policy associated with this profile.
477+
pub fn get_load_balancing_policy(&self) -> &Arc<dyn LoadBalancingPolicy> {
478+
&self.0.load_balancing_policy
479+
}
480+
481+
/// Gets retry policy associated with this profile.
482+
pub fn get_retry_policy(&self) -> &Arc<dyn RetryPolicy> {
483+
&self.0.retry_policy
484+
}
485+
486+
/// Gets speculative execution policy associated with this profile.
487+
pub fn get_speculative_execution_policy(&self) -> Option<&Arc<dyn SpeculativeExecutionPolicy>> {
488+
self.0.speculative_execution_policy.as_ref()
489+
}
460490
}
461491

462492
/// A handle that points to an ExecutionProfile.

0 commit comments

Comments
 (0)