From 56ff45d9a36040c429753d0d118ad980fbfe3eb8 Mon Sep 17 00:00:00 2001 From: Stephen Sampson <36173115+stphnsmpsn@users.noreply.github.com> Date: Mon, 26 Sep 2022 13:24:33 -0300 Subject: [PATCH] feat: add `Result` type alias for `std::result::Result` (#1085) * add `Result` type alias for `std::result::Result` * Allow user to override the error type Co-authored-by: David Pedersen * add rustdoc for `tonic::Result` * cargo fmt Co-authored-by: David Pedersen --- tonic/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tonic/src/lib.rs b/tonic/src/lib.rs index f126ada16..9ab6b6967 100644 --- a/tonic/src/lib.rs +++ b/tonic/src/lib.rs @@ -122,3 +122,7 @@ pub(crate) type Error = Box; #[cfg(feature = "codegen")] #[cfg_attr(docsrs, doc(cfg(feature = "codegen")))] pub mod codegen; + +/// `Result` is a type that represents either success ([`Ok`]) or failure ([`Err`]). +/// By default, the Err value is of type [`Status`] but this can be overridden if desired. +pub type Result = std::result::Result;