Trait ToTonicStatus

Source
pub trait ToTonicStatus
where Self: Error,
{ // Required methods fn to_status(&self, _: Code, _: impl Into<Cow<'static, str>>) -> Status; fn to_status_unnamed(&self, _: Code) -> Status; }

Required Methods§

Source

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.

Source

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.

Implementors§

Source§

impl<T> ToTonicStatus for T
where T: ?Sized + Error,