[][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 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_from_unknown(_unknown_values: &UnknownValues) -> Option<Self::Value> { ... }
fn get_cached_size(value: &Self::Value) -> u32 { ... }
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32 { ... } }

Associated Types

type Value: ProtobufValue + Clone + 'static

Loading content...

Required methods

fn wire_type() -> WireType

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

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

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

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_from_unknown(_unknown_values: &UnknownValues) -> Option<Self::Value>

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 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 + MessageStatic + ProtobufValue> ProtobufType for ProtobufTypeMessage<M>[src]

type Value = M

Loading content...