Skip to main content

Writer

Struct Writer 

Source
pub struct Writer<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Writer<'a>

Source

pub fn from_buffer(bf: &'a mut Vec<u8>) -> Writer<'a>

Source

pub fn dump(&self) -> Vec<u8>

Source

pub fn reset(&mut self)

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn reserve(&mut self, additional: usize)

Source

pub fn skip(&mut self, len: usize)

Source

pub fn set_bytes(&mut self, offset: usize, data: &[u8])

Source

pub fn write_bytes(&mut self, v: &[u8]) -> usize

Source

pub fn write_bool(&mut self, value: bool)

Source

pub fn write_i8(&mut self, value: i8)

Source

pub fn write_i16(&mut self, value: i16)

Source

pub fn write_i32(&mut self, value: i32)

Source

pub fn write_varint32(&mut self, value: i32)

Source

pub fn write_i64(&mut self, value: i64)

Source

pub fn write_varint64(&mut self, value: i64)

Source

pub fn write_tagged_i64(&mut self, value: i64)

Write signed long using fory Tagged(Small long as int) encoding. If value is in [0xc0000000, 0x3fffffff] (i.e., [-1073741824, 1073741823]), encode as 4 bytes: ((value as i32) << 1). Otherwise write as 9 bytes: 0b1 | little-endian 8 bytes i64.

Source

pub fn write_u8(&mut self, value: u8)

Source

pub fn write_u16(&mut self, value: u16)

Source

pub fn write_u32(&mut self, value: u32)

Source

pub fn write_var_uint32(&mut self, value: u32)

Source

pub fn write_u64(&mut self, value: u64)

Source

pub fn write_var_uint64(&mut self, value: u64)

Source

pub fn write_tagged_u64(&mut self, value: u64)

Write unsigned long using fory Tagged(Small long as int) encoding. If value is in [0, 0x7fffffff], encode as 4 bytes: ((value as u32) << 1). Otherwise write as 9 bytes: 0b1 | little-endian 8 bytes u64.

Source

pub fn write_f32(&mut self, value: f32)

Source

pub fn write_f64(&mut self, value: f64)

Source

pub fn write_utf8_string(&mut self, s: &str)

Source

pub fn write_i128(&mut self, value: i128)

Source

pub fn write_u128(&mut self, value: u128)

Source

pub fn write_isize(&mut self, value: isize)

Source

pub fn write_usize(&mut self, value: usize)

Source

pub fn write_var_uint36_small(&mut self, value: u64)

Auto Trait Implementations§

§

impl<'a> Freeze for Writer<'a>

§

impl<'a> RefUnwindSafe for Writer<'a>

§

impl<'a> Send for Writer<'a>

§

impl<'a> Sync for Writer<'a>

§

impl<'a> Unpin for Writer<'a>

§

impl<'a> !UnwindSafe for Writer<'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>,

Source§

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>,

Source§

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.