Skip to content

Commit 9df44f6

Browse files
committed
exec_profile_handle: allow public access to associated profile
Last time, I introduced getters for `ExecutionProfile`. However, I forgot that in cpp-rust-driver use case, we only have an access to `ExecutionProfileHandle`... Since, we can convert handle to builder, I see no objections against having the ability to convert it to well-defined execution profile. Obviously, we need to clone an `Arc`. But only a single one. Notice, however, that when converting to builder, we need to clone multiple Arcs anyway (e.g. retry or load balancing policies).
1 parent da199a1 commit 9df44f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scylla/src/transport/execution_profile.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,11 @@ impl ExecutionProfileHandle {
513513
self.0 .0.load().to_builder()
514514
}
515515

516+
/// Returns execution profile pointed by this handle.
517+
pub fn to_profile(&self) -> ExecutionProfile {
518+
ExecutionProfile(self.access())
519+
}
520+
516521
/// Makes the handle point to a new execution profile.
517522
/// All entities (queries/Session) holding this handle will reflect the change.
518523
pub fn map_to_another_profile(&mut self, profile: ExecutionProfile) {

0 commit comments

Comments
 (0)