pub enum FieldKind<'a> {
Varint(u64),
I32(u32),
I64(u64),
Len(&'a [u8]),
}
Variants§
Implementations§
Source§impl<'a> FieldKind<'a>
impl<'a> FieldKind<'a>
pub fn is_len(&self) -> bool
pub fn wire_type(&self) -> WireType
pub fn try_unwrap_varint(&self) -> Result<u64, DecodeError>
pub fn try_unwrap_i32(&self) -> Result<u32, DecodeError>
pub fn try_unwrap_i64(&self) -> Result<u64, DecodeError>
Sourcepub fn try_unwrap_len(&self) -> Result<&'a [u8], DecodeError>
pub fn try_unwrap_len(&self) -> Result<&'a [u8], DecodeError>
Returns ExpectedLenWireType if the kind is not Len
Trait Implementations§
impl<'a> Copy for FieldKind<'a>
impl<'a> Eq for FieldKind<'a>
impl<'a> StructuralPartialEq for FieldKind<'a>
Auto Trait Implementations§
impl<'a> Freeze for FieldKind<'a>
impl<'a> RefUnwindSafe for FieldKind<'a>
impl<'a> Send for FieldKind<'a>
impl<'a> Sync for FieldKind<'a>
impl<'a> Unpin for FieldKind<'a>
impl<'a> UnwindSafe for FieldKind<'a>
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