pub enum Value<'a> {
}Expand description
Variants§
U8(u8)
An unsigned 8-bit integer.
U16(u16)
An unsigned 16-bit integer.
U32(u32)
An unsigned 32-bit integer.
U64(u64)
An unsigned 64-bit integer.
I8(i8)
A signed 8-bit integer.
I16(i16)
A signed 16-bit integer.
I32(i32)
A signed 32-bit integer.
I64(i64)
A signed 64-bit integer.
F32(f32)
A 32-bit floating-point number.
F64(f64)
A 64-bit floating-point number.
Bool(bool)
A Boolean value.
String(Cow<'a, str>)
A UTF-8 string, borrowed from the input when possible.
Bytes(Cow<'a, [u8]>)
A byte array or byte vector, borrowed from the input when possible.
Vec(LazyVec<'a>)
A lazily decoded array or vector of non-byte primitives.
Implementations§
Source§impl Value<'_>
impl Value<'_>
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Returns the number of encoded payload bytes held by this value.
For scalar primitives this is their complete encoded width. For strings, bytes, and lazy vectors this is only the payload length and excludes any length prefix from a dynamically sized string or vector. Consequently, this is not necessarily the complete serialized size of the original field.