Skip to main content

BinaryWriter

Struct BinaryWriter 

Source
pub struct BinaryWriter<W, O = BigEndian> { /* private fields */ }
Expand description

Writer wrapper for fixed-width binary values.

The byte order is selected by the O type parameter. Use BinaryWriter<W, BigEndian> for big-endian data and BinaryWriter<W, LittleEndian> for little-endian data.

§Type Parameters

  • W: Underlying byte output.
  • O: Compile-time byte-order specification.

Implementations§

Source§

impl<W, O> BinaryWriter<W, O>
where O: ByteOrderSpec,

Source

pub const fn new(inner: W) -> Self

Creates a binary writer.

§Parameters
  • inner: Underlying byte writer.
§Returns

Returns a writer using the byte order selected by O.

Source

pub const fn byte_order(&self) -> ByteOrder

Returns the byte order selected by this writer.

§Returns

Returns the compile-time byte order as a runtime value.

Source

pub const fn inner(&self) -> &W

Returns a shared reference to the underlying writer.

§Returns

Returns the wrapped writer.

Source

pub fn inner_mut(&mut self) -> &mut W

Returns an exclusive reference to the underlying writer.

§Returns

Returns mutable access to the wrapped writer.

Source

pub fn into_inner(self) -> W

Consumes this wrapper and returns the underlying writer.

§Returns

Returns the wrapped writer.

Source§

impl<W> BinaryWriter<W, BigEndian>
where W: Output<Item = u8>,

Source

pub fn write_u8(&mut self, value: u8) -> Result<()>

Writes an unsigned 8-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i8(&mut self, value: i8) -> Result<()>

Writes a signed 8-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u16(&mut self, value: u16) -> Result<()>

Writes an unsigned 16-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u32(&mut self, value: u32) -> Result<()>

Writes an unsigned 32-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u64(&mut self, value: u64) -> Result<()>

Writes an unsigned 64-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u128(&mut self, value: u128) -> Result<()>

Writes an unsigned 128-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i16(&mut self, value: i16) -> Result<()>

Writes a signed 16-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i32(&mut self, value: i32) -> Result<()>

Writes a signed 32-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i64(&mut self, value: i64) -> Result<()>

Writes a signed 64-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i128(&mut self, value: i128) -> Result<()>

Writes a signed 128-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_f32(&mut self, value: f32) -> Result<()>

Writes a 32-bit float.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_f64(&mut self, value: f64) -> Result<()>

Writes a 64-bit float.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_string_with_u16_len(&mut self, value: &str) -> Result<()>

Writes a UTF-8 string prefixed by a 16-bit byte length.

§Parameters
  • value: String to length-prefix and write.
§Returns

Returns after the length and payload have been written.

§Errors

Returns an invalid-input error when the length exceeds u16::MAX, or an output error while writing.

Source

pub fn write_string_with_u32_len(&mut self, value: &str) -> Result<()>

Writes a UTF-8 string prefixed by a 32-bit byte length.

§Parameters
  • value: String to length-prefix and write.
§Returns

Returns after the length and payload have been written.

§Errors

Returns an invalid-input error when the length exceeds u32::MAX, or an output error while writing.

Source§

impl<W> BinaryWriter<W, LittleEndian>
where W: Output<Item = u8>,

Source

pub fn write_u8(&mut self, value: u8) -> Result<()>

Writes an unsigned 8-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i8(&mut self, value: i8) -> Result<()>

Writes a signed 8-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u16(&mut self, value: u16) -> Result<()>

Writes an unsigned 16-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u32(&mut self, value: u32) -> Result<()>

Writes an unsigned 32-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u64(&mut self, value: u64) -> Result<()>

Writes an unsigned 64-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u128(&mut self, value: u128) -> Result<()>

Writes an unsigned 128-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i16(&mut self, value: i16) -> Result<()>

Writes a signed 16-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i32(&mut self, value: i32) -> Result<()>

Writes a signed 32-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i64(&mut self, value: i64) -> Result<()>

Writes a signed 64-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i128(&mut self, value: i128) -> Result<()>

Writes a signed 128-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_f32(&mut self, value: f32) -> Result<()>

Writes a 32-bit float.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_f64(&mut self, value: f64) -> Result<()>

Writes a 64-bit float.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_string_with_u16_len(&mut self, value: &str) -> Result<()>

Writes a UTF-8 string prefixed by a 16-bit byte length.

§Parameters
  • value: String to length-prefix and write.
§Returns

Returns after the length and payload have been written.

§Errors

Returns an invalid-input error when the length exceeds u16::MAX, or an output error while writing.

Source

pub fn write_string_with_u32_len(&mut self, value: &str) -> Result<()>

Writes a UTF-8 string prefixed by a 32-bit byte length.

§Parameters
  • value: String to length-prefix and write.
§Returns

Returns after the length and payload have been written.

§Errors

Returns an invalid-input error when the length exceeds u32::MAX, or an output error while writing.

Source§

impl<W> BinaryWriter<W, NativeEndian>
where W: Output<Item = u8>,

Source

pub fn write_u8(&mut self, value: u8) -> Result<()>

Writes an unsigned 8-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i8(&mut self, value: i8) -> Result<()>

Writes a signed 8-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u16(&mut self, value: u16) -> Result<()>

Writes an unsigned 16-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u32(&mut self, value: u32) -> Result<()>

Writes an unsigned 32-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u64(&mut self, value: u64) -> Result<()>

Writes an unsigned 64-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_u128(&mut self, value: u128) -> Result<()>

Writes an unsigned 128-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i16(&mut self, value: i16) -> Result<()>

Writes a signed 16-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i32(&mut self, value: i32) -> Result<()>

Writes a signed 32-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i64(&mut self, value: i64) -> Result<()>

Writes a signed 64-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_i128(&mut self, value: i128) -> Result<()>

Writes a signed 128-bit integer.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_f32(&mut self, value: f32) -> Result<()>

Writes a 32-bit float.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_f64(&mut self, value: f64) -> Result<()>

Writes a 64-bit float.

§Parameters
  • value: Scalar to encode and write.
§Returns

Returns after all encoded bytes have been written.

§Errors

Returns an output error, including a write-zero error when the output stops making progress.

Source

pub fn write_string_with_u16_len(&mut self, value: &str) -> Result<()>

Writes a UTF-8 string prefixed by a 16-bit byte length.

§Parameters
  • value: String to length-prefix and write.
§Returns

Returns after the length and payload have been written.

§Errors

Returns an invalid-input error when the length exceeds u16::MAX, or an output error while writing.

Source

pub fn write_string_with_u32_len(&mut self, value: &str) -> Result<()>

Writes a UTF-8 string prefixed by a 32-bit byte length.

§Parameters
  • value: String to length-prefix and write.
§Returns

Returns after the length and payload have been written.

§Errors

Returns an invalid-input error when the length exceeds u32::MAX, or an output error while writing.

Source§

impl<W, O> BinaryWriter<W, O>
where W: Output<Item = u8>,

Source

pub fn is_buffered(&self) -> bool

Returns whether this writer buffers output.

Source

pub unsafe fn write_unchecked( &mut self, input: &[u8], index: usize, count: usize, ) -> Result<usize>

Writes up to count bytes from an indexed input range.

§Safety

index..index + count must be a valid range within input.

Source

pub fn write(&mut self, input: &[u8]) -> Result<usize>

Writes bytes from the full input slice.

Source

pub unsafe fn write_fully_unchecked( &mut self, input: &[u8], index: usize, count: usize, ) -> Result<()>

Writes all bytes from an indexed input range.

§Safety

index..index + count must be a valid range within input.

Source

pub fn write_fully(&mut self, input: &[u8]) -> Result<()>

Writes all bytes from the full input slice.

Source

pub fn flush(&mut self) -> Result<()>

Flushes buffered output.

Source§

impl<W, O> BinaryWriter<W, O>
where W: Seekable<Unit = u8>,

Source

pub fn seek_to(&mut self, position: SeekFrom) -> Result<u64>

Seeks the wrapped byte stream.

Trait Implementations§

Source§

impl<W, O> Output for BinaryWriter<W, O>
where W: Output<Item = u8>,

Source§

fn is_buffered(&self) -> bool

Reports whether the wrapped output is buffered.

§Returns

Returns the wrapped output’s buffering state.

Source§

unsafe fn write_unchecked( &mut self, input: &[u8], index: usize, count: usize, ) -> Result<usize>

Writes up to count bytes from an indexed input range.

§Parameters
  • input: Source slice.
  • index: First source index.
  • count: Maximum number of bytes to write.
§Returns

Returns the number of bytes written.

§Errors

Returns an error reported by the wrapped output.

§Safety

index..index + count must be a valid range within input.

Source§

fn flush(&mut self) -> Result<()>

Flushes the wrapped writer.

§Returns

Returns after the wrapped output has flushed.

§Errors

Returns the I/O error reported by the wrapped writer.

Source§

type Item = u8

The item type written to this output.
Source§

fn write(&mut self, input: &[Self::Item]) -> Result<usize, Error>

Writes items from the full input slice. Read more
Source§

unsafe fn write_fully_unchecked( &mut self, input: &[Self::Item], index: usize, count: usize, ) -> Result<(), Error>

Writes all items from an indexed input range. Read more
Source§

fn write_fully(&mut self, input: &[Self::Item]) -> Result<(), Error>

Writes all items from the full input slice. Read more
Source§

impl<W, O> Seekable for BinaryWriter<W, O>
where W: Seekable<Unit = u8>,

Source§

fn seek_to(&mut self, position: SeekFrom) -> Result<u64>

Seeks the wrapped writer.

§Parameters
  • position: Target seek position.
§Returns

Returns the new stream position.

§Errors

Returns the seek error reported by the wrapped writer.

Source§

type Unit = u8

The unit type used to measure seek positions and offsets.

Auto Trait Implementations§

§

impl<W, O> Freeze for BinaryWriter<W, O>
where W: Freeze, PhantomData<fn() -> O>: Freeze,

§

impl<W, O> RefUnwindSafe for BinaryWriter<W, O>

§

impl<W, O> Send for BinaryWriter<W, O>
where W: Send, PhantomData<fn() -> O>: Send,

§

impl<W, O> Sync for BinaryWriter<W, O>
where W: Sync, PhantomData<fn() -> O>: Sync,

§

impl<W, O> Unpin for BinaryWriter<W, O>
where W: Unpin, PhantomData<fn() -> O>: Unpin,

§

impl<W, O> UnsafeUnpin for BinaryWriter<W, O>

§

impl<W, O> UnwindSafe for BinaryWriter<W, O>
where W: UnwindSafe, PhantomData<fn() -> O>: UnwindSafe,

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<W> BinaryWriteExt for W
where W: Output<Item = u8> + ?Sized,

Source§

fn write_u8(&mut self, value: u8) -> Result<()>

Writes an unsigned 8-bit integer. Read more
Source§

fn write_i8(&mut self, value: i8) -> Result<()>

Writes a signed 8-bit integer. Read more
Source§

fn write_u16(&mut self, value: u16, byte_order: ByteOrder) -> Result<()>

Writes an unsigned 16-bit integer using a runtime byte order. Read more
Source§

fn write_u16_be(&mut self, value: u16) -> Result<()>

Writes a big-endian unsigned 16-bit integer. Read more
Source§

fn write_u16_le(&mut self, value: u16) -> Result<()>

Writes a little-endian unsigned 16-bit integer. Read more
Source§

fn write_u32(&mut self, value: u32, byte_order: ByteOrder) -> Result<()>

Writes an unsigned 32-bit integer using a runtime byte order. Read more
Source§

fn write_u32_be(&mut self, value: u32) -> Result<()>

Writes a big-endian unsigned 32-bit integer. Read more
Source§

fn write_u32_le(&mut self, value: u32) -> Result<()>

Writes a little-endian unsigned 32-bit integer. Read more
Source§

fn write_u64(&mut self, value: u64, byte_order: ByteOrder) -> Result<()>

Writes an unsigned 64-bit integer using a runtime byte order. Read more
Source§

fn write_u64_be(&mut self, value: u64) -> Result<()>

Writes a big-endian unsigned 64-bit integer. Read more
Source§

fn write_u64_le(&mut self, value: u64) -> Result<()>

Writes a little-endian unsigned 64-bit integer. Read more
Source§

fn write_u128(&mut self, value: u128, byte_order: ByteOrder) -> Result<()>

Writes an unsigned 128-bit integer using a runtime byte order. Read more
Source§

fn write_u128_be(&mut self, value: u128) -> Result<()>

Writes a big-endian unsigned 128-bit integer. Read more
Source§

fn write_u128_le(&mut self, value: u128) -> Result<()>

Writes a little-endian unsigned 128-bit integer. Read more
Source§

fn write_i16(&mut self, value: i16, byte_order: ByteOrder) -> Result<()>

Writes a signed 16-bit integer using a runtime byte order. Read more
Source§

fn write_i16_be(&mut self, value: i16) -> Result<()>

Writes a big-endian signed 16-bit integer. Read more
Source§

fn write_i16_le(&mut self, value: i16) -> Result<()>

Writes a little-endian signed 16-bit integer. Read more
Source§

fn write_i32(&mut self, value: i32, byte_order: ByteOrder) -> Result<()>

Writes a signed 32-bit integer using a runtime byte order. Read more
Source§

fn write_i32_be(&mut self, value: i32) -> Result<()>

Writes a big-endian signed 32-bit integer. Read more
Source§

fn write_i32_le(&mut self, value: i32) -> Result<()>

Writes a little-endian signed 32-bit integer. Read more
Source§

fn write_i64(&mut self, value: i64, byte_order: ByteOrder) -> Result<()>

Writes a signed 64-bit integer using a runtime byte order. Read more
Source§

fn write_i64_be(&mut self, value: i64) -> Result<()>

Writes a big-endian signed 64-bit integer. Read more
Source§

fn write_i64_le(&mut self, value: i64) -> Result<()>

Writes a little-endian signed 64-bit integer. Read more
Source§

fn write_i128(&mut self, value: i128, byte_order: ByteOrder) -> Result<()>

Writes a signed 128-bit integer using a runtime byte order. Read more
Source§

fn write_i128_be(&mut self, value: i128) -> Result<()>

Writes a big-endian signed 128-bit integer. Read more
Source§

fn write_i128_le(&mut self, value: i128) -> Result<()>

Writes a little-endian signed 128-bit integer. Read more
Source§

fn write_f32(&mut self, value: f32, byte_order: ByteOrder) -> Result<()>

Writes a 32-bit float using a runtime byte order. Read more
Source§

fn write_f32_be(&mut self, value: f32) -> Result<()>

Writes a big-endian 32-bit float. Read more
Source§

fn write_f32_le(&mut self, value: f32) -> Result<()>

Writes a little-endian 32-bit float. Read more
Source§

fn write_f64(&mut self, value: f64, byte_order: ByteOrder) -> Result<()>

Writes a 64-bit float using a runtime byte order. Read more
Source§

fn write_f64_be(&mut self, value: f64) -> Result<()>

Writes a big-endian 64-bit float. Read more
Source§

fn write_f64_le(&mut self, value: f64) -> Result<()>

Writes a little-endian 64-bit float. 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<W> Leb128WriteExt for W
where W: Output<Item = u8> + ?Sized,

Source§

fn write_uleb_u8(&mut self, value: u8) -> Result<()>

Writes an unsigned LEB128 u8. Read more
Source§

fn write_uleb_u16(&mut self, value: u16) -> Result<()>

Writes an unsigned LEB128 u16. Read more
Source§

fn write_uleb_u32(&mut self, value: u32) -> Result<()>

Writes an unsigned LEB128 u32. Read more
Source§

fn write_uleb_u64(&mut self, value: u64) -> Result<()>

Writes an unsigned LEB128 u64. Read more
Source§

fn write_uleb_u128(&mut self, value: u128) -> Result<()>

Writes an unsigned LEB128 u128. Read more
Source§

fn write_uleb_usize(&mut self, value: usize) -> Result<()>

Writes an unsigned LEB128 usize. Read more
Source§

fn write_sleb_i8(&mut self, value: i8) -> Result<()>

Writes a signed LEB128 i8. Read more
Source§

fn write_sleb_i16(&mut self, value: i16) -> Result<()>

Writes a signed LEB128 i16. Read more
Source§

fn write_sleb_i32(&mut self, value: i32) -> Result<()>

Writes a signed LEB128 i32. Read more
Source§

fn write_sleb_i64(&mut self, value: i64) -> Result<()>

Writes a signed LEB128 i64. Read more
Source§

fn write_sleb_i128(&mut self, value: i128) -> Result<()>

Writes a signed LEB128 i128. Read more
Source§

fn write_sleb_isize(&mut self, value: isize) -> Result<()>

Writes a signed LEB128 isize. Read more
Source§

impl<T> SeekableOutput for T
where T: Output + Seekable<Unit = <T as Output>::Item>,

Source§

impl<T> StringWriteExt for T
where T: Output<Item = u8> + ?Sized,

Source§

fn write_utf8_payload(&mut self, value: &str) -> Result<(), Error>

Writes a UTF-8 payload without a length prefix. Read more
Source§

fn write_utf8_string_uleb_usize(&mut self, value: &str) -> Result<(), Error>

Writes a UTF-8 string with an unsigned LEB128 byte-length prefix. Read more
Source§

fn write_utf8_string_uleb_u64(&mut self, value: &str) -> Result<(), Error>

Writes a UTF-8 string with an unsigned LEB128 u64 byte-length prefix. Read more
Source§

fn write_string_with_u16_len( &mut self, value: &str, byte_order: ByteOrder, ) -> Result<(), Error>

Writes a UTF-8 string with a runtime-order u16 byte-length prefix. Read more
Source§

fn write_string_with_u16_len_be(&mut self, value: &str) -> Result<(), Error>

Writes a UTF-8 string with a big-endian u16 byte-length prefix. Read more
Source§

fn write_string_with_u16_len_le(&mut self, value: &str) -> Result<(), Error>

Writes a UTF-8 string with a little-endian u16 byte-length prefix. Read more
Source§

fn write_string_with_u32_len( &mut self, value: &str, byte_order: ByteOrder, ) -> Result<(), Error>

Writes a UTF-8 string with a runtime-order u32 byte-length prefix. Read more
Source§

fn write_string_with_u32_len_be(&mut self, value: &str) -> Result<(), Error>

Writes a UTF-8 string with a big-endian u32 byte-length prefix. Read more
Source§

fn write_string_with_u32_len_le(&mut self, value: &str) -> Result<(), Error>

Writes a UTF-8 string with a little-endian u32 byte-length prefix. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<W> ZigZagWriteExt for W
where W: Output<Item = u8> + ?Sized,

Source§

fn write_zig_zag_i8(&mut self, value: i8) -> Result<()>

Writes a ZigZag i8. Read more
Source§

fn write_zig_zag_i16(&mut self, value: i16) -> Result<()>

Writes a ZigZag i16. Read more
Source§

fn write_zig_zag_i32(&mut self, value: i32) -> Result<()>

Writes a ZigZag i32. Read more
Source§

fn write_zig_zag_i64(&mut self, value: i64) -> Result<()>

Writes a ZigZag i64. Read more
Source§

fn write_zig_zag_i128(&mut self, value: i128) -> Result<()>

Writes a ZigZag i128. Read more
Source§

fn write_zig_zag_isize(&mut self, value: isize) -> Result<()>

Writes a ZigZag isize. Read more