#[repr(transparent)]pub struct Record<P: Value, const F: u32, const O: bool> {
pub value: P,
}Expand description
A record is responsible for encoding the field number, wire type and payload. The wire type tells the parser how big the payload after it is. For more details, refer to the Condensed Reference Card.
The P is the payload, the F is the field number, and O is whether to
apply the zero-sized optimization or not. Most of the time, it shouldn’t
matter if the optimization is applied. However, if something is part of
a repeated field, then applying the optimization would change the number
of elements in the array.
Fields§
§value: PThe value of the record. This is pub because of a quirk in Rust’s
orphan rules which prevent implementing From<Record<P,...> for P.
Trait Implementations§
Source§impl<P: Value, const F: u32, const O: bool> Value for Record<P, F, O>
§Safety
The Default implementation will return all zero-representations.
impl<P: Value, const F: u32, const O: bool> Value for Record<P, F, O>
§Safety
The Default implementation will return all zero-representations.
impl<P: Copy + Value, const F: u32, const O: bool> Copy for Record<P, F, O>
impl<P: Eq + Value, const F: u32, const O: bool> Eq for Record<P, F, O>
impl<P: Value, const F: u32, const O: bool> StructuralPartialEq for Record<P, F, O>
Auto Trait Implementations§
impl<P, const F: u32, const O: bool> Freeze for Record<P, F, O>where
P: Freeze,
impl<P, const F: u32, const O: bool> RefUnwindSafe for Record<P, F, O>where
P: RefUnwindSafe,
impl<P, const F: u32, const O: bool> Send for Record<P, F, O>where
P: Send,
impl<P, const F: u32, const O: bool> Sync for Record<P, F, O>where
P: Sync,
impl<P, const F: u32, const O: bool> Unpin for Record<P, F, O>where
P: Unpin,
impl<P, const F: u32, const O: bool> UnsafeUnpin for Record<P, F, O>where
P: UnsafeUnpin,
impl<P, const F: u32, const O: bool> UnwindSafe for Record<P, F, O>where
P: UnwindSafe,
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