Trait protobuf::types::ProtobufType [−][src]
Protobuf elementary type as generic trait
Associated Types
type Value: ProtobufValue + Clone + 'static
[src]
Rust type of value
Required methods
fn wire_type() -> WireType
[src]
Wire type when writing to stream
fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<Self::Value>
[src]
Read value from CodedInputStream
fn compute_size(value: &Self::Value) -> u32
[src]
Compute wire size
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<Self::Value>
[src]
Get value from UnknownValues
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<()>
Write a value with previously cached size
Provided methods
fn compute_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
Compute size adding length prefix if wire type is length delimited (i. e. string, bytes, message)
fn get_cached_size(value: &Self::Value) -> u32
[src]
Get previously computed size
fn get_cached_size_with_length_delimiter(value: &Self::Value) -> u32
[src]
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<()>
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<()>
impl ProtobufType for ProtobufTypeCarllercheBytes
[src]
type Value = Bytes
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<Self::Value>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<Bytes>
[src]
fn compute_size(value: &Bytes) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &Bytes,
os: &mut CodedOutputStream<'_>
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &Bytes,
os: &mut CodedOutputStream<'_>
) -> ProtobufResult<()>
impl ProtobufType for ProtobufTypeCarllercheChars
[src]
type Value = Chars
fn wire_type() -> WireType
[src]
fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<Self::Value>
[src]
fn get_from_unknown(unknown_values: &UnknownValues) -> Option<Chars>
[src]
fn compute_size(value: &Chars) -> u32
[src]
fn write_with_cached_size(
field_number: u32,
value: &Chars,
os: &mut CodedOutputStream<'_>
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &Chars,
os: &mut CodedOutputStream<'_>
) -> ProtobufResult<()>
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<()>
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<()>
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<()>
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<()>
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]
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>