pub trait ProtobufRef<'pool> {
// Required method
fn as_dyn<'msg>(&'msg self) -> DynamicMessageRef<'pool, 'msg>;
// Provided methods
fn descriptor(&self) -> &'pool ProtoType { ... }
fn encode_flat<'a, const STACK_DEPTH: usize>(
&self,
buffer: &'a mut [u8],
) -> Result<&'a [u8], Error> { ... }
fn encode_vec<const STACK_DEPTH: usize>(&self) -> Result<Vec<u8>, Error> { ... }
}Expand description
Read-only protobuf operations (encode, serialize, inspect).
Required Methods§
Sourcefn as_dyn<'msg>(&'msg self) -> DynamicMessageRef<'pool, 'msg>
fn as_dyn<'msg>(&'msg self) -> DynamicMessageRef<'pool, 'msg>
Get a dynamic view of this message for reflection.
Provided Methods§
Sourcefn descriptor(&self) -> &'pool ProtoType
fn descriptor(&self) -> &'pool ProtoType
Get the message’s descriptor (schema metadata).
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.