[−][src]Trait protobuf::types::ProtobufType
Protobuf elementary type as generic trait
Associated Types
type Value: ProtobufValue + Clone + 'static
Rust type of value
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<()>
field_number: u32,
value: &Self::Value,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
Write a value with previously cached size
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
Implementors
impl ProtobufType for ProtobufTypeBool
[src]
type Value = bool
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<bool>
[src]
fn get_from_unknown(unknown: &UnknownValues) -> Option<bool>
[src]
fn compute_size(_value: &bool) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &bool,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &bool,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeBytes
[src]
type Value = Vec<u8>
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<Vec<u8>>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<Vec<u8>>
[src]
fn compute_size(value: &Vec<u8>) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &Vec<u8>,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &Vec<u8>,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeDouble
[src]
type Value = f64
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<f64>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<f64>
[src]
fn compute_size(_value: &f64) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &f64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &f64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeFixed32
[src]
type Value = u32
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<u32>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<u32>
[src]
fn compute_size(_value: &u32) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &u32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &u32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeFixed64
[src]
type Value = u64
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<u64>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<u64>
[src]
fn compute_size(_value: &u64) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &u64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &u64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeFloat
[src]
type Value = f32
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<f32>
[src]
fn compute_size(_value: &f32) -> u32
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<f32>
[src]
fn write_with_cached_size(
field_number: u32,
value: &f32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &f32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeInt32
[src]
type Value = i32
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<i32>
[src]
fn compute_size(value: &i32) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &i32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &i32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i32>
[src]
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeInt64
[src]
type Value = i64
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<i64>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i64>
[src]
fn compute_size(value: &i64) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &i64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &i64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeSfixed32
[src]
type Value = i32
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<i32>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i32>
[src]
fn compute_size(_value: &i32) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &i32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &i32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeSfixed64
[src]
type Value = i64
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<i64>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i64>
[src]
fn compute_size(_value: &i64) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &i64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &i64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeSint32
[src]
type Value = i32
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<i32>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i32>
[src]
fn compute_size(value: &i32) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &i32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &i32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeSint64
[src]
type Value = i64
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<i64>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i64>
[src]
fn compute_size(value: &i64) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &i64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &i64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeString
[src]
type Value = String
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<String>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<String>
[src]
fn compute_size(value: &String) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &String,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &String,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeUint32
[src]
type Value = u32
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<u32>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<u32>
[src]
fn compute_size(value: &u32) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &u32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &u32,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl ProtobufType for ProtobufTypeUint64
[src]
type Value = u64
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<u64>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<u64>
[src]
fn compute_size(value: &u64) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &u64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &u64,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl<E: ProtobufEnum + ProtobufValue> ProtobufType for ProtobufTypeEnum<E>
[src]
type Value = E
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<E>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<E>
[src]
fn compute_size(value: &E) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &E,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &E,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
fn get_cached_size(value: &Self::Value) -> u32
[src]
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
impl<M: Message + Clone + ProtobufValue> ProtobufType for ProtobufTypeMessage<M>
[src]
type Value = M
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream) -> ProtobufResult<M>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<M>
[src]
fn compute_size(value: &M) -> u32
[src]
fn get_cached_size(value: &M) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &Self::Value,
os: &mut CodedOutputStream
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &Self::Value,
os: &mut CodedOutputStream
) -> ProtobufResult<()>