Skip to content

Commit 16dfdfa

Browse files
committed
RSCBC-263: Indicate API stability via API doc
1 parent 20bd591 commit 16dfdfa

File tree

4 files changed

+10
-39
lines changed

4 files changed

+10
-39
lines changed

sdk/couchbase/Cargo.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,8 @@ default = ["default-tls"]
5050
default-tls = ["rustls-tls"]
5151
rustls-tls = ["dep:tokio-rustls", "couchbase-core/rustls-tls", "dep:rustls-pemfile"]
5252
native-tls = ["dep:tokio-native-tls", "couchbase-core/native-tls"]
53-
54-
# Volatile: This feature is subject to change at any time
55-
# Enables options for DNS-SRV bootstrap.
56-
unstable-dns-options = []
57-
58-
# Uncomitted: This feature may change in the future
59-
# Allows explicit construction of the Error type e.g. for mocking purposes.
60-
unstable-error-construction = []
53+
# Note that we do not use feature flags to indicate API stability level.
54+
# Instead, unstable features are marked with comments indicating uncommitted or volatile stability levels.
6155

6256
internal = []
6357

sdk/couchbase/src/clients/cluster_client.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ use std::time::Duration;
4747

4848
use crate::authenticator::Authenticator;
4949
use crate::clients::tracing_client::{CouchbaseTracingClient, TracingClient, TracingClientBackend};
50-
#[cfg(feature = "unstable-dns-options")]
5150
use std::mem::take;
5251

5352
pub(crate) struct ClusterClient {
@@ -70,10 +69,7 @@ impl ClusterClient {
7069
// the dns options out for resolve.
7170
// We could create a new type to pass into the backend connect functions but it just
7271
// seems unnecessary.
73-
#[cfg(feature = "unstable-dns-options")]
7472
let dns_options = take(&mut opts.dns_options).map(couchbase_connstr::DnsConfig::from);
75-
#[cfg(not(feature = "unstable-dns-options"))]
76-
let dns_options = None;
7773

7874
let resolved_conn_spec = resolve(conn_spec, dns_options).await?;
7975

sdk/couchbase/src/error.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,12 @@ pub struct Error {
6666
}
6767

6868
impl Error {
69-
#[cfg(feature = "unstable-error-construction")]
69+
/// Allows explicit construction of the Error type e.g. for mocking purposes.
70+
/// **Uncommitted: This feature may change in the future**.
7071
pub fn new(kind: ErrorKind) -> Self {
7172
Self::new_internal(kind)
7273
}
7374

74-
#[cfg(not(feature = "unstable-error-construction"))]
75-
pub(crate) fn new(kind: ErrorKind) -> Self {
76-
Self::new_internal(kind)
77-
}
78-
7975
/// Returns the [`ErrorKind`] describing the category of this error.
8076
pub fn kind(&self) -> &ErrorKind {
8177
&self.kind
@@ -553,10 +549,7 @@ impl InvalidArgumentErrorKind {
553549
&self.msg
554550
}
555551

556-
/// Creates a new `InvalidArgumentErrorKind`.
557-
///
558-
/// Only available with the `unstable-error-construction` feature.
559-
#[cfg(feature = "unstable-error-construction")]
552+
/// Creates a new `InvalidArgumentErrorKind`. **Uncommitted: This feature may change in the future**.
560553
pub fn new(arg: impl Into<Option<String>>, msg: impl Into<String>) -> Self {
561554
Self {
562555
msg: msg.into(),
@@ -589,10 +582,7 @@ impl FeatureNotAvailableErrorKind {
589582
self.msg.as_deref()
590583
}
591584

592-
/// Creates a new `FeatureNotAvailableErrorKind`.
593-
///
594-
/// Only available with the `unstable-error-construction` feature.
595-
#[cfg(feature = "unstable-error-construction")]
585+
/// Creates a new `FeatureNotAvailableErrorKind`. **Uncommitted: This feature may change in the future**.
596586
pub fn new(feature: impl Into<String>, msg: impl Into<Option<String>>) -> Self {
597587
Self {
598588
feature: feature.into(),

sdk/couchbase/src/options/cluster_options.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ pub struct ClusterOptions {
8181
pub http_options: HttpOptions,
8282
/// Configuration for the key-value (memcached) connections.
8383
pub kv_options: KvOptions,
84-
/// DNS configuration. Only available with the `unstable-dns-options` feature.
85-
#[cfg(feature = "unstable-dns-options")]
84+
/// DNS configuration. **Volatile: This feature is subject to change at any time**.
8685
pub dns_options: Option<DnsOptions>,
8786
/// Configuration for the orphan response reporter.
8887
pub orphan_reporter_options: OrphanReporterOptions,
@@ -117,7 +116,6 @@ impl ClusterOptions {
117116
poller_options: PollerOptions::new(),
118117
http_options: HttpOptions::new(),
119118
kv_options: KvOptions::new(),
120-
#[cfg(feature = "unstable-dns-options")]
121119
dns_options: None,
122120
orphan_reporter_options: OrphanReporterOptions::new(),
123121
default_retry_strategy: None,
@@ -160,10 +158,7 @@ impl ClusterOptions {
160158
self
161159
}
162160

163-
/// Sets the DNS configuration.
164-
///
165-
/// Only available with the `unstable-dns-options` feature.
166-
#[cfg(feature = "unstable-dns-options")]
161+
/// Sets the DNS configuration. **Volatile: This feature is subject to change at any time**.
167162
pub fn dns_options(mut self, dns_options: DnsOptions) -> Self {
168163
self.dns_options = Some(dns_options);
169164
self
@@ -685,19 +680,16 @@ impl Display for TlsOptions {
685680
}
686681
}
687682

688-
/// Custom DNS resolver configuration.
689-
///
690-
/// Only available with the `unstable-dns-options` feature.
683+
/// Custom DNS resolver configuration. **Volatile: This feature is subject to change at any time**.
691684
#[derive(Clone, Debug, PartialEq)]
692685
#[non_exhaustive]
693-
#[cfg(feature = "unstable-dns-options")]
694686
pub struct DnsOptions {
695687
/// The DNS server address to use for SRV and A/AAAA lookups.
696688
pub namespace: SocketAddr,
697689
/// Timeout for DNS resolution.
698690
pub timeout: Option<Duration>,
699691
}
700-
#[cfg(feature = "unstable-dns-options")]
692+
701693
impl DnsOptions {
702694
/// Creates a new `DnsOptions` with the given DNS server address.
703695
pub fn new(namespace: SocketAddr) -> Self {
@@ -713,7 +705,6 @@ impl DnsOptions {
713705
self
714706
}
715707
}
716-
#[cfg(feature = "unstable-dns-options")]
717708
impl From<DnsOptions> for couchbase_connstr::DnsConfig {
718709
fn from(opts: DnsOptions) -> Self {
719710
couchbase_connstr::DnsConfig {

0 commit comments

Comments
 (0)