Skip to content

Commit

Permalink
feat(generator/rust): re-export Result and Error
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
coryan committed Jan 31, 2025
1 parent 0b70522 commit 07548a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion generator/internal/rust/templates/crate/src/lib.rs.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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 <PLACEHOLDERS>, rustdoc does not like those. }}
#[allow(rustdoc::invalid_html_tags)]
Expand Down
2 changes: 1 addition & 1 deletion src/gax/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//! change both if needed.
//! </div>
/// 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<T> = std::result::Result<T, crate::error::Error>;
Expand Down

0 comments on commit 07548a4

Please sign in to comment.