pub trait ProtobufType {
    type Value: ProtobufValue + Clone + 'static;
    fn wire_type() -> WireType;
fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<Self::Value>;
fn compute_size(value: &Self::Value) -> u32;
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<Self::Value>;
fn write_with_cached_size(
        field_number: u32,
        value: &Self::Value,
        os: &mut CodedOutputStream<'_>
    ) -> ProtobufResult<()>; fn compute_size_with_length_delimiter(value: &Self::Value) -> u32 { ... }
fn get_cached_size(value: &Self::Value) -> u32 { ... }
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32 { ... } }
Expand description

Protobuf elementary type as generic trait

Associated Types

Rust type of value

Required methods

Wire type when writing to stream

Read value from CodedInputStream

Compute wire size

Get value from UnknownValues

Write a value with previously cached size

Provided methods

Compute size adding length prefix if wire type is length delimited (i. e. string, bytes, message)

Get previously computed size

Get previously cached size with length prefix

Implementors