pub trait ToTonicStatuswhere
Self: Error,{
// Required methods
fn to_status(&self, _: Code, _: impl Into<Cow<'static, str>>) -> Status;
fn to_status_unnamed(&self, _: Code) -> Status;
}
Required Methods§
sourcefn 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
.
sourcefn 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
.
Object Safety§
This trait is not object safe.