From 07548a4a546ee09ed332ed64cc8372a8357981bd Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Fri, 31 Jan 2025 10:48:53 -0500 Subject: [PATCH] feat(generator/rust): re-export Result and Error Application developers may need to name these types when using a generated client. Re-exporting the types makes it possible to name them unambiguously, something that may be hard (or impossible?) in complex applications where there may be more than one version of `gax`. --- generator/internal/rust/templates/crate/src/lib.rs.mustache | 3 ++- src/gax/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/generator/internal/rust/templates/crate/src/lib.rs.mustache b/generator/internal/rust/templates/crate/src/lib.rs.mustache index 556a835af..66f20a0a0 100644 --- a/generator/internal/rust/templates/crate/src/lib.rs.mustache +++ b/generator/internal/rust/templates/crate/src/lib.rs.mustache @@ -37,7 +37,8 @@ limitations under the License. pub mod model; {{#HasServices}} -pub(crate) use gax::Result; +pub use gax::Result; +pub use gax::error::Error; {{! Google APIs often use angle brackets for , rustdoc does not like those. }} #[allow(rustdoc::invalid_html_tags)] diff --git a/src/gax/src/lib.rs b/src/gax/src/lib.rs index 9de09062e..2cb6f8b9b 100644 --- a/src/gax/src/lib.rs +++ b/src/gax/src/lib.rs @@ -30,7 +30,7 @@ //! change both if needed. //! -/// An alias of [std::result::Result] where the error is always [crate::error::Error]. +/// An alias of [std::result::Result] where the error is always [Error][crate::error::Error]. /// /// This is the result type used by all functions wrapping RPCs. pub type Result = std::result::Result;