Skip to content

Commit 40aaee6

Browse files
authored
Merge pull request #781 from wprzytula/session-builder-where-to-put-methods
session_builder: Stress that new options should go to proper mode
2 parents fa09c1c + 13620b1 commit 40aaee6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scylla/src/transport/session_builder.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ pub struct GenericSessionBuilder<Kind: SessionBuilderKind> {
7171
kind: PhantomData<Kind>,
7272
}
7373

74-
impl SessionBuilder {
74+
// NOTE: this `impl` block contains configuration options specific for **non-Cloud** [`Session`].
75+
// This means that if an option fits both non-Cloud and Cloud `Session`s, it should NOT be put
76+
// here, but rather in `impl<K> GenericSessionBuilder<K>` block.
77+
impl GenericSessionBuilder<DefaultMode> {
7578
/// Creates new SessionBuilder with default configuration
7679
/// # Default configuration
7780
/// * Compression: None
@@ -332,6 +335,10 @@ impl SessionBuilder {
332335
self
333336
}
334337
}
338+
339+
// NOTE: this `impl` block contains configuration options specific for **Cloud** [`Session`].
340+
// This means that if an option fits both non-Cloud and Cloud `Session`s, it should NOT be put
341+
// here, but rather in `impl<K> GenericSessionBuilder<K>` block.
335342
#[cfg(feature = "cloud")]
336343
impl CloudSessionBuilder {
337344
/// Creates a new SessionBuilder with default configuration,
@@ -356,6 +363,8 @@ impl CloudSessionBuilder {
356363
}
357364
}
358365

366+
// This block contains configuration options that make sense both for Cloud and non-Cloud
367+
// `Session`s. If an option fit only one of them, it should be put in a specialised block.
359368
impl<K: SessionBuilderKind> GenericSessionBuilder<K> {
360369
/// Set preferred Compression algorithm.
361370
/// The default is no compression.

0 commit comments

Comments
 (0)