pub enum FieldWireType {
Varint = 0,
Bytes = 1,
Nested = 2,
}Expand description
Field wire types within a block body.
Every field in a block body is encoded as a tag-length-value (TLV) triple:
field_id (varint) │ wire_type (varint) │ payloadThe wire type determines how the payload is structured:
┌──────┬──────────┬────────────────────────────────┐
│ Wire │ Type │ Payload format │
├──────┼──────────┼────────────────────────────────┤
│ 0 │ Varint │ Single varint value │
│ 1 │ Bytes │ Varint length + raw bytes │
│ 2 │ Nested │ Varint length + nested TLV │
└──────┴──────────┴────────────────────────────────┘This is intentionally protobuf-like: readers can skip unknown fields by inspecting the wire type and consuming the correct number of bytes, enabling forward compatibility.
Variants§
Implementations§
Source§impl FieldWireType
impl FieldWireType
Trait Implementations§
Source§impl Clone for FieldWireType
impl Clone for FieldWireType
Source§fn clone(&self) -> FieldWireType
fn clone(&self) -> FieldWireType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FieldWireType
impl Debug for FieldWireType
Source§impl PartialEq for FieldWireType
impl PartialEq for FieldWireType
impl Copy for FieldWireType
impl Eq for FieldWireType
impl StructuralPartialEq for FieldWireType
Auto Trait Implementations§
impl Freeze for FieldWireType
impl RefUnwindSafe for FieldWireType
impl Send for FieldWireType
impl Sync for FieldWireType
impl Unpin for FieldWireType
impl UnsafeUnpin for FieldWireType
impl UnwindSafe for FieldWireType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more