[][src]Trait protobuf::types::ProtobufType

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 { ... } }

Protobuf elementary type as generic trait

Associated Types

type Value: ProtobufValue + Clone + 'static

Rust type of value

Loading content...

Required methods

fn wire_type() -> WireType

Wire type when writing to stream

fn read(is: &mut CodedInputStream) -> ProtobufResult<Self::Value>

Read value from CodedInputStream

fn compute_size(value: &Self::Value) -> u32

Compute wire size

fn get_from_unknown(unknown_values: &UnknownValues) -> Option<Self::Value>

Get value from UnknownValues

fn write_with_cached_size(
    field_number: u32,
    value: &Self::Value,
    os: &mut CodedOutputStream
) -> ProtobufResult<()>

Write a value with previously cached size

Loading content...

Provided methods

fn compute_size_with_length_delimiter(value: &Self::Value) -> u32

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

fn get_cached_size(value: &Self::Value) -> u32

Get previously computed size

fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32

Get previously cached size with length prefix

Loading content...

Implementors

impl ProtobufType for ProtobufTypeBool[src]

type Value = bool

impl ProtobufType for ProtobufTypeBytes[src]

type Value = Vec<u8>

impl ProtobufType for ProtobufTypeCarllercheBytes[src]

type Value = Bytes

impl ProtobufType for ProtobufTypeCarllercheChars[src]

type Value = Chars

impl ProtobufType for ProtobufTypeDouble[src]

type Value = f64

impl ProtobufType for ProtobufTypeFixed32[src]

type Value = u32

impl ProtobufType for ProtobufTypeFixed64[src]

type Value = u64

impl ProtobufType for ProtobufTypeFloat[src]

type Value = f32

impl ProtobufType for ProtobufTypeInt32[src]

type Value = i32

impl ProtobufType for ProtobufTypeInt64[src]

type Value = i64

impl ProtobufType for ProtobufTypeSfixed32[src]

type Value = i32

impl ProtobufType for ProtobufTypeSfixed64[src]

type Value = i64

impl ProtobufType for ProtobufTypeSint32[src]

type Value = i32

impl ProtobufType for ProtobufTypeSint64[src]

type Value = i64

impl ProtobufType for ProtobufTypeString[src]

type Value = String

impl ProtobufType for ProtobufTypeUint32[src]

type Value = u32

impl ProtobufType for ProtobufTypeUint64[src]

type Value = u64

impl<E: ProtobufEnum + ProtobufValue> ProtobufType for ProtobufTypeEnum<E>[src]

type Value = E

impl<M: Message + Clone + ProtobufValue> ProtobufType for ProtobufTypeMessage<M>[src]

type Value = M

Loading content...