pub struct ZigZagWriter<W> { /* private fields */ }Expand description
Implementations§
Source§impl<W> ZigZagWriter<W>
impl<W> ZigZagWriter<W>
Sourcepub fn is_buffered(&self) -> bool
pub fn is_buffered(&self) -> bool
Returns whether this writer buffers output.
Sourcepub unsafe fn write_unchecked(
&mut self,
input: &[u8],
index: usize,
count: usize,
) -> Result<usize>
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.
Sourcepub unsafe fn write_fully_unchecked(
&mut self,
input: &[u8],
index: usize,
count: usize,
) -> Result<()>
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.
Sourcepub fn write_fully(&mut self, input: &[u8]) -> Result<()>
pub fn write_fully(&mut self, input: &[u8]) -> Result<()>
Writes all bytes from the full input slice.
Source§impl<W> ZigZagWriter<W>
impl<W> ZigZagWriter<W>
Source§impl<W> ZigZagWriter<W>
impl<W> ZigZagWriter<W>
Source§impl<W> ZigZagWriter<W>
impl<W> ZigZagWriter<W>
Sourcepub fn write_i128(&mut self, value: i128) -> Result<()>
pub fn write_i128(&mut self, value: i128) -> Result<()>
Sourcepub fn write_isize(&mut self, value: isize) -> Result<()>
pub fn write_isize(&mut self, value: isize) -> Result<()>
Trait Implementations§
Source§impl<W> Output for ZigZagWriter<W>
impl<W> Output for ZigZagWriter<W>
Source§fn is_buffered(&self) -> bool
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>
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 write(&mut self, input: &[Self::Item]) -> Result<usize, Error>
fn write(&mut self, input: &[Self::Item]) -> Result<usize, Error>
Writes items from the full input slice. Read more
Auto Trait Implementations§
impl<W> Freeze for ZigZagWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for ZigZagWriter<W>where
W: RefUnwindSafe,
impl<W> Send for ZigZagWriter<W>where
W: Send,
impl<W> Sync for ZigZagWriter<W>where
W: Sync,
impl<W> Unpin for ZigZagWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for ZigZagWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for ZigZagWriter<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<W> BinaryWriteExt for W
impl<W> BinaryWriteExt for W
Source§fn write_u16(&mut self, value: u16, byte_order: ByteOrder) -> Result<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
fn write_f64(&mut self, value: f64, byte_order: ByteOrder) -> Result<()>
Writes a 64-bit float using a runtime byte order. Read more
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<W> Leb128WriteExt for W
impl<W> Leb128WriteExt for W
Source§fn write_uleb_u16(&mut self, value: u16) -> Result<()>
fn write_uleb_u16(&mut self, value: u16) -> Result<()>
Writes an unsigned LEB128
u16. Read moreSource§fn write_uleb_u32(&mut self, value: u32) -> Result<()>
fn write_uleb_u32(&mut self, value: u32) -> Result<()>
Writes an unsigned LEB128
u32. Read moreSource§fn write_uleb_u64(&mut self, value: u64) -> Result<()>
fn write_uleb_u64(&mut self, value: u64) -> Result<()>
Writes an unsigned LEB128
u64. Read moreSource§fn write_uleb_u128(&mut self, value: u128) -> Result<()>
fn write_uleb_u128(&mut self, value: u128) -> Result<()>
Writes an unsigned LEB128
u128. Read moreSource§fn write_uleb_usize(&mut self, value: usize) -> Result<()>
fn write_uleb_usize(&mut self, value: usize) -> Result<()>
Writes an unsigned LEB128
usize. Read moreSource§impl<T> StringWriteExt for T
impl<T> StringWriteExt for T
Source§fn write_utf8_payload(&mut self, value: &str) -> Result<(), Error>
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>
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>
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 moreSource§fn write_string_with_u16_len(
&mut self,
value: &str,
byte_order: ByteOrder,
) -> Result<(), Error>
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 moreSource§fn write_string_with_u16_len_be(&mut self, value: &str) -> Result<(), Error>
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 moreSource§fn write_string_with_u16_len_le(&mut self, value: &str) -> Result<(), Error>
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 moreSource§fn write_string_with_u32_len(
&mut self,
value: &str,
byte_order: ByteOrder,
) -> Result<(), Error>
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