Trait ToTonicStatus
pub trait ToTonicStatus: Error {
// Required methods
fn to_status(&self, _: Code, _: impl Into<Cow<'static, str>>) -> Status;
fn to_status_unnamed(&self, _: Code) -> Status;
}Required Methods§
fn to_status(&self, _: Code, _: impl Into<Cow<'static, str>>) -> Status
fn to_status(&self, _: Code, _: impl Into<Cow<'static, str>>) -> Status
Convert the error to tonic::Status with the given tonic::Code and service name.
The source chain is preserved by pairing with TonicStatusWrapper.
fn to_status_unnamed(&self, _: Code) -> Status
fn to_status_unnamed(&self, _: Code) -> Status
Convert the error to tonic::Status with the given tonic::Code without specifying
the service name. Prefer [to_status] if possible.
The source chain is preserved by pairing with TonicStatusWrapper.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.