Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove #[doc(hidden)] from stable crates #3226

Merged
merged 15 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,15 @@ message = "Add `Display` impl for `DateTime`."
references = ["smithy-rs#3183"]
meta = { "breaking" = false, "tada" = true, "bug" = false, "target" = "all" }
author = "HakanVardarr"

[[smithy-rs]]
message = "Types/functions that were previously `#[doc(hidden)]` in `aws-smithy-async`, `aws-smithy-runtime-api`, `aws-smithy-runtime`, `aws-smithy-types`, and the SDK crates are now visible. For those that are not intended to be used directly, they are called out in their docs as such."
references = ["smithy-rs#3226"]
meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client" }
author = "ysaito1001"

[[aws-sdk-rust]]
message = "Types/functions that were previously `#[doc(hidden)]` in `aws-config`, `aws-inlineable`, `aws-types`, and the SDK crates are now visible. For those that are not intended to be used directly, they are called out in their docs as such."
references = ["smithy-rs#3226"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "ysaito1001"
3 changes: 1 addition & 2 deletions aws/rust-runtime/aws-config/src/default_provider/app_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ pub struct Builder {
}

impl Builder {
#[doc(hidden)]
/// Configure the default chain
///
/// Exposed for overriding the environment when unit-testing providers
pub fn configure(self, configuration: &ProviderConfig) -> Self {
pub(crate) fn configure(self, configuration: &ProviderConfig) -> Self {
Self {
provider_config: configuration.clone(),
}
Expand Down
3 changes: 1 addition & 2 deletions aws/rust-runtime/aws-config/src/default_provider/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ pub struct Builder {
}

impl Builder {
#[doc(hidden)]
/// Configure the default chain
///
/// Exposed for overriding the environment when unit-testing providers
pub fn configure(mut self, configuration: &ProviderConfig) -> Self {
pub(crate) fn configure(mut self, configuration: &ProviderConfig) -> Self {
self.env_provider = EnvironmentVariableRegionProvider::new_with_env(configuration.env());
self.profile_file = self.profile_file.configure(configuration);
self.imds = self.imds.configure(configuration);
Expand Down
3 changes: 1 addition & 2 deletions aws/rust-runtime/aws-config/src/environment/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ impl EnvironmentVariableCredentialsProvider {
Self::new_with_env(Env::real())
}

#[doc(hidden)]
/// Create a new `EnvironmentVariableCredentialsProvider` with `Env` overridden
///
/// This function is intended for tests that mock out the process environment.
pub fn new_with_env(env: Env) -> Self {
pub(crate) fn new_with_env(env: Env) -> Self {
Self { env }
}
}
Expand Down
3 changes: 1 addition & 2 deletions aws/rust-runtime/aws-config/src/environment/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ impl EnvironmentVariableRegionProvider {
EnvironmentVariableRegionProvider { env: Env::real() }
}

#[doc(hidden)]
/// Create an region provider from a given `Env`
///
/// This method is used for tests that need to override environment variables.
pub fn new_with_env(env: Env) -> Self {
pub(crate) fn new_with_env(env: Env) -> Self {
EnvironmentVariableRegionProvider { env }
}
}
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-config/src/profile/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl From<ProfileParseError> for ProfileFileLoadError {
}
}

#[doc(hidden)]
/// An error encountered while reading the AWS config file
#[derive(Debug, Clone)]
pub struct CouldNotReadProfileFile {
pub(crate) path: PathBuf,
Expand Down
3 changes: 1 addition & 2 deletions aws/rust-runtime/aws-inlineable/src/s3_request_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ where
}

/// Applies the extended request ID to a generic error builder
#[doc(hidden)]
pub fn apply_extended_request_id(
pub(crate) fn apply_extended_request_id(
builder: ErrorMetadataBuilder,
headers: &Headers,
) -> ErrorMetadataBuilder {
Expand Down
1 change: 0 additions & 1 deletion aws/rust-runtime/aws-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
pub mod app_name;
pub mod build_metadata;
pub mod endpoint_config;
#[doc(hidden)]
pub mod os_shim_internal;
pub mod region;
pub mod request_id;
Expand Down
4 changes: 4 additions & 0 deletions aws/rust-runtime/aws-types/src/os_shim_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ impl Default for Fs {
}

impl Fs {
/// Create `Fs` representing a real file system.
pub fn real() -> Self {
Fs(fs::Inner::Real)
}

/// Create `Fs` from a map of `OsString` to `Vec<u8>`.
pub fn from_raw_map(fs: HashMap<OsString, Vec<u8>>) -> Self {
Fs(fs::Inner::Fake(Arc::new(Fake::MapFs(Mutex::new(fs)))))
}

/// Create `Fs` from a map of `String` to `Vec<u8>`.
pub fn from_map(data: HashMap<String, impl Into<Vec<u8>>>) -> Self {
let fs = data
.into_iter()
Expand Down Expand Up @@ -224,6 +227,7 @@ impl Default for Env {
}

impl Env {
/// Retrieve a value for the given `k` and return `VarError` is that key is not present.
pub fn get(&self, k: &str) -> Result<String, VarError> {
use env::Inner;
match &self.0 {
Expand Down
3 changes: 1 addition & 2 deletions aws/rust-runtime/aws-types/src/sdk_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ use aws_smithy_runtime_api::shared::IntoShared;
pub use aws_smithy_types::retry::RetryConfig;
pub use aws_smithy_types::timeout::TimeoutConfig;

#[doc(hidden)]
/// Unified docstrings to keep crates in sync. Not intended for public use
pub mod unified_docs {
/// A macro that generates docs for selected fields of `SdkConfig`.
#[macro_export]
macro_rules! docs_for {
(use_fips) => {
Expand Down Expand Up @@ -667,7 +667,6 @@ impl SdkConfig {
self.timeout_config.as_ref()
}

#[doc(hidden)]
/// Configured sleep implementation
pub fn sleep_impl(&self) -> Option<SharedAsyncSleep> {
self.sleep_impl.clone()
Expand Down
1 change: 1 addition & 0 deletions aws/sdk/sdk-external-types.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ allowed_external_types = [
"aws_smithy_eventstream::*",

"aws_smithy_runtime::client::identity::cache::IdentityCache",
"aws_smithy_runtime::client::retries::RetryPartition",

"aws_runtime::invocation_id::SharedInvocationIdGenerator",
"aws_runtime::invocation_id::InvocationIdGenerator",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import software.amazon.smithy.rust.codegen.client.smithy.ClientRustModule
import software.amazon.smithy.rust.codegen.client.smithy.configReexport
import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ConfigCustomization
import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ServiceConfig
import software.amazon.smithy.rust.codegen.core.rustlang.Attribute
import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate
import software.amazon.smithy.rust.codegen.core.rustlang.writable
import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType
Expand Down Expand Up @@ -65,7 +64,6 @@ class ResiliencyConfigCustomization(codegenContext: ClientCodegenContext) : Conf
self.config.load::<#{TimeoutConfig}>()
}

##[doc(hidden)]
/// Returns a reference to the retry partition contained in this config, if any.
///
/// WARNING: This method is unstable and may be removed at any time. Do not rely on this
Expand Down Expand Up @@ -248,7 +246,6 @@ class ResiliencyConfigCustomization(codegenContext: ClientCodegenContext) : Conf
*codegenScope,
)

Attribute.DocHidden.render(this)
rustTemplate(
"""
/// Set the partition for retry-related state. When clients share a retry partition, they will
Expand All @@ -262,7 +259,6 @@ class ResiliencyConfigCustomization(codegenContext: ClientCodegenContext) : Conf
*codegenScope,
)

Attribute.DocHidden.render(this)
rustTemplate(
"""
/// Set the partition for retry-related state. When clients share a retry partition, they will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import software.amazon.smithy.rust.codegen.client.smithy.protocols.ClientHttpBou
import software.amazon.smithy.rust.codegen.core.rustlang.Attribute
import software.amazon.smithy.rust.codegen.core.rustlang.Attribute.Companion.derive
import software.amazon.smithy.rust.codegen.core.rustlang.RustWriter
import software.amazon.smithy.rust.codegen.core.rustlang.docs
import software.amazon.smithy.rust.codegen.core.rustlang.implBlock
import software.amazon.smithy.rust.codegen.core.rustlang.isNotEmpty
import software.amazon.smithy.rust.codegen.core.rustlang.rust
Expand Down Expand Up @@ -77,10 +78,9 @@ open class OperationGenerator(
)
Attribute(derive(RuntimeType.Clone, RuntimeType.Default, RuntimeType.Debug)).render(operationWriter)
Attribute.NonExhaustive.render(operationWriter)
Attribute.DocHidden.render(operationWriter)
operationWriter.rust("pub struct $operationName;")
operationWriter.implBlock(symbolProvider.toSymbol(operationShape)) {
Attribute.DocHidden.render(operationWriter)
docs("Creates a new `$operationName`")
rustBlock("pub fn new() -> Self") {
rust("Self")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub(crate) mod sealed {
///
/// Currently the trait may not be implemented by clients so we can make changes in the future
/// without breaking code depending on it.
#[doc(hidden)]
pub trait Collectable<T> {
type Collection;

Expand Down
Loading
Loading