pub struct Tag {
pub field_number: FieldNumber,
pub wire_type: WireType,
}
Expand description
A protobuf tag has two parts: A field_number
and a wire_type
.
Fields§
§field_number: FieldNumber
The field number of this tag.
wire_type: WireType
The wire type of this tag.
Trait Implementations§
source§impl Packable for Tag
impl Packable for Tag
source§fn pack_sz(&self) -> usize
fn pack_sz(&self) -> usize
pack_sz
returns the number of bytes required to serialize the Packable object.source§fn pack(&self, buf: &mut [u8])
fn pack(&self, buf: &mut [u8])
pack
fills in the buffer out
with the packed binary representation of the Packable
object. The implementor is responsible to ensure that out
is exactly pack_sz()
bytes
and implementations are encouraged to assert this. Read moresource§fn stream<W>(&self, writer: &mut W) -> Result<usize, Error>
fn stream<W>(&self, writer: &mut W) -> Result<usize, Error>
stream
writes the object to the provided writer using the same representation that would
be used in a call to pack
. The implementor is responsible for making sure that the
number of bytes written is exactly equal to the number of required bytes. Read moresource§impl<'a> Unpackable<'a> for Tag
impl<'a> Unpackable<'a> for Tag
impl Copy for Tag
impl Eq for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnwindSafe for Tag
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