feat: add Result<T> type alias for std::result::Result<T, tonic::Status> (#1085)
* add `Result<T>` type alias for `std::result::Result<T, tonic::Status>` * Allow user to override the error type Co-authored-by: David Pedersen <[email protected]> * add rustdoc for `tonic::Result` * cargo fmt Co-authored-by: David Pedersen <[email protected]>
This commit is contained in:
co-authored by
David Pedersen
parent
3e40d819cf
commit
56ff45d9a3
@@ -122,3 +122,7 @@ pub(crate) type Error = Box<dyn std::error::Error + Send + Sync>;
|
||||
#[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<T, E = Status> = std::result::Result<T, E>;
|
||||
|
||||
Reference in New Issue
Block a user