Skip to main content

BufferedLeb128Writer

Struct BufferedLeb128Writer 

Source
pub struct BufferedLeb128Writer<W>
where W: ByteOutput,
{ /* private fields */ }
Expand description

Buffered writer for canonical LEB128 integers.

Values are encoded directly into the internal output buffer and flushed to the wrapped writer in larger chunks.

§Flush contract

Dropping this writer delegates to qubit_io::BufferedOutput, which makes a best-effort attempt to drain pending bytes, ignores drop-time errors, and does not guarantee that the wrapped writer itself is flushed. Call Output::flush to guarantee that all bytes reach the wrapped output. Self::inner can observe the wrapped writer before pending bytes have been flushed.

§Target-width integers

usize and isize methods use the current Rust target’s pointer width. Prefer fixed-width integer methods such as write_u64 or write_i64 for persistent files and cross-platform protocols.

§Type Parameters

  • W: Underlying byte output.

§Examples

use qubit_io::ByteOutput;
use qubit_io_binary::BufferedLeb128Writer;

let mut writer = BufferedLeb128Writer::new(Vec::new());
writer.write_u32(300)?;
writer.flush()?;
assert_eq!(writer.inner(), &[0xAC, 0x02]);

Implementations§

Source§

impl<W> BufferedLeb128Writer<W>
where W: ByteOutput,

Source

pub fn is_buffered(&self) -> bool

Returns whether this writer buffers output.

§Returns

Returns true when writes may be retained in an internal buffer.

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.

§Parameters
  • input: Source byte buffer.
  • index: Start of the readable range.
  • count: Maximum number of bytes to write.
§Returns

Returns the number of bytes written.

§Errors

Returns the underlying output error.

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

§Parameters
  • input: Source byte buffer.
§Returns

Returns the number of bytes written.

§Errors

Returns the underlying output error.

Source

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

Writes all bytes from an indexed input range.

§Parameters
  • input: Source byte buffer.
  • index: Start of the readable range.
  • count: Number of bytes to write.
§Errors

Returns the underlying output error if the complete range cannot be written.

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

§Parameters
  • input: Source byte buffer.
§Errors

Returns the underlying output error if the complete slice cannot be written.

Source

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

Flushes buffered output.

§Errors

Returns the underlying output error if buffered bytes cannot be flushed.

Source§

impl<W> BufferedLeb128Writer<W>

Source

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

Seeks the wrapped byte stream; see Seekable::seek_to for the seek contract. Buffered wrappers interpret relative offsets and report positions relative to their logical stream position. A position query does not flush buffered output.

§Parameters
  • position: Relative or absolute target position.
§Returns

Returns the resulting stream position in bytes. For buffered wrappers this is the logical position, including buffered data.

§Errors

Returns the underlying seek error.

Source§

impl<W> BufferedLeb128Writer<W>
where W: ByteOutput,

Source

pub fn new(inner: W) -> Self

Creates a buffered LEB128 writer with the default buffer capacity.

§Parameters
  • inner: Underlying byte output.
§Returns

Returns a buffered canonical LEB128 writer.

Source

pub fn with_capacity(inner: W, capacity: usize) -> Self

Creates a buffered LEB128 writer with at least capacity bytes.

§Parameters
  • inner: Underlying byte output.
  • capacity: Requested internal buffer capacity in bytes.
§Returns

Returns a buffered writer whose capacity also satisfies the largest supported codec payload.

Source

pub fn try_with_capacity( inner: W, capacity: usize, ) -> Result<Self, TryReserveError>

Tries to create a buffered LEB128 writer with at least capacity bytes.

§Parameters
  • inner: Underlying byte output to wrap.
  • capacity: Requested internal buffer capacity in bytes. The request is raised when necessary to fit the largest supported codec payload.
§Returns

Returns a buffered writer on successful allocation. Its capacity satisfies both the request and the minimum required by the supported codecs.

§Errors

Returns a TryReserveError if the buffer capacity overflows or its allocation fails.

Source

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

Returns a shared reference to the underlying writer.

Pending bytes may still be held in this wrapper’s internal buffer.

§Returns

Returns the wrapped writer.

Source

pub fn into_parts(self) -> (W, BufferedOutputRecovery<u8>)

Recovers the wrapped writer and the status of bytes retained by this writer.

This method performs no I/O and does not call Self::flush. Pending bytes were not reported as written and may be retried. Indeterminate means an inner write panicked and may have produced an external prefix; do not replay it automatically. Flush first for normal completion.

Pending contains only bytes retained by this buffer. It does not include payload bytes that a failed high-level write never accepted. An empty pending buffer, or a successful later flush, does not mean that such a failed field was completed.

§Returns

Returns the wrapped writer and pending or indeterminate bytes in logical write order.

Source

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

Writes a UTF-8 string prefixed by an unsigned LEB128 byte length.

The length prefix is encoded as usize, so this format is target-width dependent. Prefer a fixed-width length prefix for persistent files and cross-platform protocols.

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

Returns after the length and payload have been accepted.

§Errors

Returns an output error encountered while making buffer space.

§Partial writes

This operation is not transactional. An I/O error may leave the length prefix and part of the payload retained by this writer or already accepted by the wrapped output. Retrying this whole method can write a second prefix; recover using the enclosing protocol’s framing or transaction boundary instead.

Source

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

Writes a UTF-8 string prefixed by an unsigned LEB128 u64 byte length.

Prefer this method over Self::write_utf8_string_usize for persistent files and cross-platform protocols because the length field is independent of the current Rust target’s pointer width.

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

Returns after the length and payload have been accepted.

§Errors

Returns an invalid-input error when the length cannot fit in u64, or an output error encountered while making buffer space.

§Partial writes

This operation is not transactional. An I/O error may leave the length prefix and part of the payload retained by this writer or already accepted by the wrapped output. Retrying this whole method can write a second prefix; recover using the enclosing protocol’s framing or transaction boundary instead.

Source§

impl<W> BufferedLeb128Writer<W>
where W: ByteOutput,

Source

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

Writes an unsigned LEB128 u8.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Source

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

Writes an unsigned LEB128 u16.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Source

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

Writes an unsigned LEB128 u32.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Source

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

Writes an unsigned LEB128 u64.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Source

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

Writes an unsigned LEB128 u128.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Source

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

Writes an unsigned LEB128 usize.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Source

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

Writes a signed LEB128 i8.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Source

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

Writes a signed LEB128 i16.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Source

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

Writes a signed LEB128 i32.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Source

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

Writes a signed LEB128 i64.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Source

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

Writes a signed LEB128 i128.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Source

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

Writes a signed LEB128 isize.

§Parameters
  • value: Integer to encode and buffer.
§Returns

Returns after the canonical payload has been accepted.

§Errors

Returns an output error encountered while making buffer space.

Trait Implementations§

Source§

impl<W> Output for BufferedLeb128Writer<W>
where W: ByteOutput,

Source§

type Item = u8

Byte elements accepted by this writer.

Source§

fn is_buffered(&self) -> bool

Reports that this adapter buffers output.

§Returns

Always returns true.

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 accepted.

§Errors

Returns an output error encountered while draining pending bytes.

§Safety

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

Source§

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

Flushes the internal buffer and then the wrapped writer.

§Returns

Returns after buffered and wrapped output have flushed.

§Errors

Returns an error encountered while draining or flushing.

Source§

fn into_std_write(self) -> StdWrite<Self> ⓘ
where Self: Sized + ByteOutput,

Converts this byte output into a standard library writer. Read more
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§

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

Writes items from multiple buffers in list order. Read more
Source§

impl<W> Seekable for BufferedLeb128Writer<W>

Source§

type Unit = u8

Positioning unit used by the byte-oriented seek interface.

Source§

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

Seeks relative to this writer’s logical position. For SeekFrom::Current(0), returns the logical position including pending bytes without draining them. Other requests drain pending bytes before repositioning the wrapped output, but do not flush that output. Call Self::flush explicitly when buffered data and the wrapped output must be flushed.

§Parameters
  • position: Target seek position.
§Returns

Returns the new logical stream position in bytes.

§Errors

Returns an error encountered while draining pending bytes or seeking.

Auto Trait Implementations§

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

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: ByteOutput + ?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> SeekableByteOutput for T
where T: SeekableOutput<Item = u8, Unit = u8> + ?Sized,

Source§

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

Source§

impl<T> StringWriteExt for T
where T: ByteOutput + ?Sized,

Source§

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

Writes the string’s UTF-8 bytes without adding a length prefix.

A write failure may occur after some payload bytes have reached the underlying output.

§Parameters
  • value: UTF-8 string whose bytes are written to the output.
§Returns

Returns after all UTF-8 payload bytes have been written.

§Errors

Returns an I/O error from the underlying output.

Source§

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

Writes the UTF-8 byte length as target-width-dependent unsigned LEB128, followed by the string bytes.

A failure can leave a partial prefix or payload in the output.

§Parameters
  • value: UTF-8 string to write after its target-width-dependent byte length.
§Returns

Returns after the length prefix and payload have been written.

§Errors

Returns an I/O error from writing the prefix or payload.

Source§

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

Writes the UTF-8 byte length as unsigned LEB128 u64, then the string bytes.

Returns InvalidInput if the byte length does not fit in u64; a write failure can leave a partial prefix or payload in the output.

§Parameters
  • value: UTF-8 string to write after its u64 byte length.
§Returns

Returns after the length prefix and payload have been written.

§Errors

Returns InvalidInput if the byte length does not fit in u64, or an I/O error while writing.

Source§

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

Writes a u16 UTF-8 byte-length prefix in the requested byte order, followed by the string bytes.

Returns InvalidInput if the byte length exceeds u16::MAX; a write failure can leave a partial prefix or payload in the output.

§Parameters
  • value: UTF-8 string to write after its u16 byte length.
  • byte_order: Byte order used to encode the length prefix.
§Returns

Returns after the length prefix and payload have been written.

§Errors

Returns InvalidInput if the byte length exceeds u16::MAX, or an I/O error while writing.

Source§

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

Writes a big-endian u16 UTF-8 byte-length prefix, then the string bytes.

Returns InvalidInput if the byte length exceeds u16::MAX; a write failure can leave a partial prefix or payload in the output.

§Parameters
  • value: UTF-8 string to write after its big-endian u16 byte length.
§Returns

Returns after the length prefix and payload have been written.

§Errors

Returns InvalidInput if the byte length exceeds u16::MAX, or an I/O error while writing.

Source§

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

Writes a little-endian u16 UTF-8 byte-length prefix, then the string bytes.

Returns InvalidInput if the byte length exceeds u16::MAX; a write failure can leave a partial prefix or payload in the output.

§Parameters
  • value: UTF-8 string to write after its little-endian u16 byte length.
§Returns

Returns after the length prefix and payload have been written.

§Errors

Returns InvalidInput if the byte length exceeds u16::MAX, or an I/O error while writing.

Source§

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

Writes a u32 UTF-8 byte-length prefix in the requested byte order, followed by the string bytes.

Returns InvalidInput if the byte length exceeds u32::MAX; a write failure can leave a partial prefix or payload in the output.

§Parameters
  • value: UTF-8 string to write after its u32 byte length.
  • byte_order: Byte order used to encode the length prefix.
§Returns

Returns after the length prefix and payload have been written.

§Errors

Returns InvalidInput if the byte length exceeds u32::MAX, or an I/O error while writing.

Source§

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

Writes a big-endian u32 UTF-8 byte-length prefix, then the string bytes.

Returns InvalidInput if the byte length exceeds u32::MAX; a write failure can leave a partial prefix or payload in the output.

§Parameters
  • value: UTF-8 string to write after its big-endian u32 byte length.
§Returns

Returns after the length prefix and payload have been written.

§Errors

Returns InvalidInput if the byte length exceeds u32::MAX, or an I/O error while writing.

Source§

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

Writes a little-endian u32 UTF-8 byte-length prefix, then the string bytes.

Returns InvalidInput if the byte length exceeds u32::MAX; a write failure can leave a partial prefix or payload in the output.

§Parameters
  • value: UTF-8 string to write after its little-endian u32 byte length.
§Returns

Returns after the length prefix and payload have been written.

§Errors

Returns InvalidInput if the byte length exceeds u32::MAX, or an I/O error while writing.

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: ByteOutput + ?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