Trait protobuf::types::ProtobufType
[−]
[src]
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
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<()>
field_number: u32,
value: &Self::Value,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
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
Implementors
impl ProtobufType for ProtobufTypeFloat type Value = f32;
impl ProtobufType for ProtobufTypeDouble type Value = f64;
impl ProtobufType for ProtobufTypeInt32 type Value = i32;
impl ProtobufType for ProtobufTypeInt64 type Value = i64;
impl ProtobufType for ProtobufTypeUint32 type Value = u32;
impl ProtobufType for ProtobufTypeUint64 type Value = u64;
impl ProtobufType for ProtobufTypeSint32 type Value = i32;
impl ProtobufType for ProtobufTypeSint64 type Value = i64;
impl ProtobufType for ProtobufTypeFixed32 type Value = u32;
impl ProtobufType for ProtobufTypeFixed64 type Value = u64;
impl ProtobufType for ProtobufTypeSfixed32 type Value = i32;
impl ProtobufType for ProtobufTypeSfixed64 type Value = i64;
impl ProtobufType for ProtobufTypeBool type Value = bool;
impl ProtobufType for ProtobufTypeString type Value = String;
impl ProtobufType for ProtobufTypeBytes type Value = Vec<u8>;
impl<E: ProtobufEnum + ProtobufValue> ProtobufType for ProtobufTypeEnum<E> type Value = E;
impl<M: Message + MessageStatic + ProtobufValue> ProtobufType for ProtobufTypeMessage<M> type Value = M;