Trait ToProto

Source
pub trait ToProto<P>: Protobuf<P>
where P: From<Self> + Message + Name + Default, Self::Error: Display,
{ // Provided methods fn type_url() -> String { ... } fn to_any(self) -> Any { ... } }
Expand description

Types that implement this trait can be converted to a raw Protobuf Any type.

Provided Methods§

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, P> ToProto<P> for T
where T: Protobuf<P>, P: From<T> + Message + Name + Default, <T as TryFrom<P>>::Error: Display,