[][src]Struct picopb::PbReader

pub struct PbReader<'a> { /* fields omitted */ }

Decode from raw bytes.

Implementations

impl PbReader<'_>[src]

pub fn new<'a>(buf: &'a [u8]) -> PbReader<'a>[src]

Create from raw bytes.

pub fn is_eof(&self) -> bool[src]

Is the parsing finished and EOF.

pub fn peek_next_key(&self) -> Result<(u8, WireType), Error>[src]

Peek next key(field_number, wire_type).

pub fn next_key(&mut self) -> Result<(u8, WireType), Error>[src]

Parse next key(field_number, wire_type).

pub fn skip_next_field(&mut self) -> Result<(), Error>[src]

Skip next field, including key and filed value.

pub fn next_fixed32(&mut self) -> Result<[u8; 4], Error>[src]

Parse a fixed32.

pub fn next_fixed64(&mut self) -> Result<[u8; 8], Error>[src]

Parse a fixed64.

pub fn next_varint(&mut self) -> Result<u64, Error>[src]

Parse a varint.

pub fn next_bytes(&mut self) -> Result<&[u8], Error>[src]

Parse a bytes array.

pub fn next_string(&mut self) -> Result<&str, Error>[src]

Parse a string.

pub fn next_embedded_message(&mut self) -> Result<PbReader<'_>, Error>[src]

Parse next bytes array as embedded message(sub-field).

pub fn next_svarint(&mut self) -> Result<i64, Error>[src]

Parse next svarint.

Auto Trait Implementations

impl<'a> Send for PbReader<'a>[src]

impl<'a> Sync for PbReader<'a>[src]

impl<'a> Unpin for PbReader<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.