pub struct Field {
pub field_number: FieldNumber,
pub value: FieldValue,
}Expand description
A raw field read from the wire
Contains the field number and the raw field value. The caller must interpret the value based on the message schema.
Fields§
§field_number: FieldNumber§value: FieldValueImplementations§
Source§impl Field
impl Field
Sourcepub fn new(field_number: FieldNumber, value: FieldValue) -> Self
pub fn new(field_number: FieldNumber, value: FieldValue) -> Self
Create a new field with the given field number and value
Sourcepub fn encoded_size(&self) -> usize
pub fn encoded_size(&self) -> usize
Calculate the total encoded size of this field in bytes (tag + value)
Trait Implementations§
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnwindSafe for Field
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