[−][src]Trait protobuf::types::ProtobufType
Protobuf elementary type as generic trait
Associated Types
type Value: ProtobufValue + Clone + 'static
[src]
Rust type of value
Required methods
pub fn wire_type() -> WireType
[src]
Wire type when writing to stream
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<Self::Value>
[src]
Read value from CodedInputStream
pub fn compute_size(value: &Self::Value) -> u32
[src]
Compute wire size
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<Self::Value>
[src]
Get value from UnknownValues
pub 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
pub 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)
pub fn get_cached_size(value: &Self::Value) -> u32
[src]
Get previously computed size
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<bool>
[src]
pub fn get_from_unknown(unknown: &UnknownValues) -> Option<bool>
[src]
pub fn compute_size(_value: &bool) -> u32
[src]
pub 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>
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<Vec<u8>>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<Vec<u8>>
[src]
pub fn compute_size(value: &Vec<u8>) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<Self::Value>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<Bytes>
[src]
pub fn compute_size(value: &Bytes) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<Self::Value>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<Chars>
[src]
pub fn compute_size(value: &Chars) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<f64>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<f64>
[src]
pub fn compute_size(_value: &f64) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<u32>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<u32>
[src]
pub fn compute_size(_value: &u32) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<u64>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<u64>
[src]
pub fn compute_size(_value: &u64) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<f32>
[src]
pub fn compute_size(_value: &f32) -> u32
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<f32>
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<i32>
[src]
pub fn compute_size(value: &i32) -> u32
[src]
pub fn write_with_cached_size(
field_number: u32,
value: &i32,
os: &mut CodedOutputStream<'_>
) -> ProtobufResult<()>
[src]
field_number: u32,
value: &i32,
os: &mut CodedOutputStream<'_>
) -> ProtobufResult<()>
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i32>
[src]
impl ProtobufType for ProtobufTypeInt64
[src]
type Value = i64
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<i64>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i64>
[src]
pub fn compute_size(value: &i64) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<i32>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i32>
[src]
pub fn compute_size(_value: &i32) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<i64>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i64>
[src]
pub fn compute_size(_value: &i64) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<i32>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i32>
[src]
pub fn compute_size(value: &i32) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<i64>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<i64>
[src]
pub fn compute_size(value: &i64) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<String>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<String>
[src]
pub fn compute_size(value: &String) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<u32>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<u32>
[src]
pub fn compute_size(value: &u32) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<u64>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<u64>
[src]
pub fn compute_size(value: &u64) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<E>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<E>
[src]
pub fn compute_size(value: &E) -> u32
[src]
pub 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
pub fn wire_type() -> WireType
[src]
pub fn read(is: &mut CodedInputStream<'_>) -> ProtobufResult<M>
[src]
pub fn get_from_unknown(unknown_values: &UnknownValues) -> Option<M>
[src]
pub fn compute_size(value: &M) -> u32
[src]
pub fn get_cached_size(value: &M) -> u32
[src]
pub 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<()>