pub struct BytesWriter<'a> { /* private fields */ }
Expand description

A writer backend for byte buffers

Implementations§

source§

impl<'a> BytesWriter<'a>

source

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

Create a new BytesWriter to write into buf

Trait Implementations§

source§

impl<'a> WriterBackend for BytesWriter<'a>

source§

fn pb_write_u8(&mut self, x: u8) -> Result<()>

Write a u8
source§

fn pb_write_u32(&mut self, x: u32) -> Result<()>

Write a u32
source§

fn pb_write_i32(&mut self, x: i32) -> Result<()>

Write a i32
source§

fn pb_write_f32(&mut self, x: f32) -> Result<()>

Write a f32
source§

fn pb_write_u64(&mut self, x: u64) -> Result<()>

Write a u64
source§

fn pb_write_i64(&mut self, x: i64) -> Result<()>

Write a i64
source§

fn pb_write_f64(&mut self, x: f64) -> Result<()>

Write a f64
source§

fn pb_write_all(&mut self, buf: &[u8]) -> Result<()>

Write all bytes in buf

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for BytesWriter<'a>

§

impl<'a> Send for BytesWriter<'a>

§

impl<'a> Sync for BytesWriter<'a>

§

impl<'a> Unpin for BytesWriter<'a>

§

impl<'a> !UnwindSafe for BytesWriter<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.