[][src]Struct picopb::PbWriter

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

Encode to raw bytes.

Implementations

impl PbWriter<'_>[src]

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

Create a PbWriter from raw mut bytes.

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

Is the buffer full?

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

Encode a raw varint.

pub fn encode_varint_field(
    &mut self,
    field_number: u8,
    value: u64
) -> Result<(), Error>
[src]

Encode a varint field.

pub fn encode_svarint_field(
    &mut self,
    field_number: u8,
    value: i64
) -> Result<(), Error>
[src]

Encode a svarint field.

pub fn encode_bytes_field(
    &mut self,
    field_number: u8,
    value: &[u8]
) -> Result<(), Error>
[src]

Encode a bytes field.

pub fn encode_string_field(
    &mut self,
    field_number: u8,
    value: &str
) -> Result<(), Error>
[src]

Encode a string field.

pub fn as_bytes(&self) -> &[u8][src]

The raw protobuf bytes encoded.

Auto Trait Implementations

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

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

impl<'a> Unpin for PbWriter<'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.