Struct Putter

Source
pub struct Putter<B: ?Sized> { /* private fields */ }
Expand description

A putter for writing to a buffer without modifying the original buffer’s cursor.

Putter provides a non-destructive way to write buffer contents by maintaining its own independent cursor position. This is particularly useful when you need to:

  • Preview write operations before committing them
  • Write data that might need to be rolled back
  • Implement transactional write operations
  • Share write access to the same buffer data from different positions
  • Test serialization without modifying the original buffer

The putter can be constrained to a specific range within the buffer, making it safe for write operations that should not exceed certain boundaries.

§Examples

use bufkit::{BufMut, Putter};

let mut data = [0u8; 10];
let mut putter = Putter::new(&mut data[..]);  // No need for &mut &mut

// Write without affecting the original buffer's cursor
putter.put_u8(0x42);
putter.put_u16_le(0x1234);

// Original buffer's state is unchanged until we access it
// The writes are staged in the putter's view

Implementations§

Source§

impl<B> Putter<B>

Source

pub fn new(buf: impl Into<WriteBuf<B>>) -> Self
where B: BufMut,

Creates a new Putter instance with the given buffer.

The putter starts at the beginning of the buffer’s current position and can write to all remaining space in the buffer.

§Examples
use bufkit::{BufMut, Putter};

let mut data = [0u8; 10];
let putter = Putter::new(&mut data[..]);
assert_eq!(putter.remaining_mut(), 10);
Source

pub const fn const_new(buf: B) -> Self

Creates a new Putter instance with the given buffer.

The putter starts at the beginning of the buffer’s current position and can write to all remaining space in the buffer.

§Examples
use bufkit::{BufMut, Putter};

let mut data = [0u8; 10];
let mut slice: &mut [u8] = &mut data[..];
let putter = Putter::const_new(&mut slice);
assert_eq!(putter.remaining_mut(), 10);
Source

pub fn with_limit(buf: impl Into<WriteBuf<B>>, limit: usize) -> Self

Creates a new Putter constrained to a specific length.

This is useful when you want to ensure the putter cannot write beyond a certain number of bytes, providing additional safety for serialization operations.

§Examples
use bufkit::{BufMut, Putter};

let mut data = [0u8; 10];
let putter = Putter::with_limit(&mut data[..], 5); // Only write first 5 bytes
assert_eq!(putter.remaining_mut(), 5);
Source

pub const fn const_with_limit(buf: WriteBuf<B>, limit: usize) -> Self

Creates a new Putter constrained to a specific length.

This is useful when you want to ensure the putter cannot write beyond a certain number of bytes, providing additional safety for serialization operations.

§Examples
use bufkit::{BufMut, Putter};

let mut data = [0u8; 10];
let putter = Putter::const_with_limit((&mut data[..]).into(), 5); // Only write first 5 bytes
assert_eq!(putter.remaining_mut(), 5);
Source

pub fn with_range( buf: impl Into<WriteBuf<B>>, range: impl RangeBounds<usize>, ) -> Self
where B: BufMut,

Creates a new Putter with specific start and end bounds.

This provides maximum flexibility in defining the putter’s range, allowing for more complex write scenarios.

§Examples
use core::ops::Bound;
use bufkit::{BufMut, Putter};

let mut data = [0u8; 10];

// Write from index 2 to 7 (exclusive)
let putter = Putter::with_range(&mut data[..], 2..7);
assert_eq!(putter.remaining_mut(), 5);
Source

pub const fn position(&self) -> usize

Returns the current position of the internal cursor relative to the start of the buffer.

This represents how far the putter’s cursor has advanced from its starting position.

§Examples
use bufkit::{BufMut, Putter};

let mut data = [0u8; 10];
let mut putter = Putter::new(&mut data[..]);

assert_eq!(putter.position(), 0);
putter.write_u8(0x42);
assert_eq!(putter.position(), 1);
putter.advance_mut(2);
assert_eq!(putter.position(), 3);
Source

pub const fn absolute_position(&self) -> usize

Returns the absolute position of the putter’s cursor in the underlying buffer.

This is the position relative to the start of the buffer, not just the putter’s starting point. This is useful for understanding where the putter is writing in the context of the entire buffer.

§Examples
use bufkit::{BufMut, Putter};
use core::ops::Bound;

let mut data = [0u8; 10];
let mut putter = Putter::with_range(&mut data[..], 3..7);

putter.write_u8(0x42);
assert_eq!(putter.absolute_position(), 4); // 3 (offset) + 1 (written)
Source

pub const fn reset_position(&mut self)

Resets the putter’s to the initial state.

After calling this method, the putter will start writing from the same position and the same limit where it was initially created.

This method will not clean the dirty state of the putter, which means any previously written data will still be present in the buffer. See also reset.

§Examples
use bufkit::{BufMut, Putter};

let mut data = [0u8; 10];
let mut putter = Putter::new(&mut data[..]);

putter.advance_mut(3);
assert_eq!(putter.position(), 3);

putter.reset_position();
assert_eq!(putter.position(), 0);
assert_eq!(putter.remaining_mut(), 10);
Source

pub fn reset(&mut self)
where B: BufMut,

Resets the putter’s buffer to its initial state, filling the written area with zeros.

This method clears the buffer’s contents from the start position to the limit position, effectively resetting the buffer to a clean state.

§Examples
use bufkit::{BufMut, Putter};

let mut data = [0u8; 10];
let mut putter = Putter::new(&mut data[..]);

putter.put_u8(0x42);
assert_eq!(putter.buffer_mut()[0], 0x42);

putter.reset();
assert_eq!(putter.buffer_mut()[0], 0x00); // The first byte is reset to zero
Source

pub fn into_inner(self) -> B

Consumes the putter and returns the underlying buffer.

Any writes made through the putter will be reflected in the returned buffer. This is useful when you want to finalize the writes and retrieve the modified buffer.

§Examples
use bufkit::{BufMut, Putter};

let mut data = [0u8; 10];
let mut putter = Putter::new(&mut data[..]);
putter.put_u8(0x42);
let buf = putter.into_inner();
assert_eq!(buf[0], 0x42);

Trait Implementations§

Source§

impl<B: BufMut + ?Sized> BufMut for Putter<B>

Source§

fn remaining_mut(&self) -> usize

Returns the number of bytes available for writing in the buffer. Read more
Source§

fn buffer_mut(&mut self) -> &mut [u8]

Returns the entire initialized buffer as a remaining_mut slice. Read more
Source§

fn advance_mut(&mut self, cnt: usize)

Advances the internal cursor by the specified number of bytes. Read more
Source§

fn try_advance_mut(&mut self, cnt: usize) -> Result<(), TryAdvanceError>

Attempts to advance the internal cursor by the specified number of bytes. Read more
Source§

fn truncate_mut(&mut self, new_len: usize)

Shortens the buffer to the specified length, keeping the first len bytes. Read more
Source§

fn has_remaining_mut(&self) -> bool

Returns true if the buffer has available space for writing. Read more
Source§

fn buffer_mut_from(&mut self, offset: usize) -> &mut [u8]

Returns a remaining_mut slice of the buffer starting from the specified offset. Read more
Source§

fn buffer_mut_from_checked(&mut self, offset: usize) -> Option<&mut [u8]>

Returns a remaining_mut slice of the buffer starting from the specified offset. Read more
Source§

fn fill(&mut self, value: u8)

Fills the entire buffer with the specified byte value. Read more
Source§

fn prefix_mut(&mut self, len: usize) -> &mut [u8]

Returns a remaining_mut slice containing the first len bytes of the buffer. Read more
Source§

fn prefix_mut_checked(&mut self, len: usize) -> Option<&mut [u8]>

Returns a remaining_mut slice containing the first len bytes of the buffer. Read more
Source§

fn suffix_mut(&mut self, len: usize) -> &mut [u8]

Returns a remaining_mut slice containing the last len bytes of the buffer. Read more
Source§

fn suffix_mut_checked(&mut self, len: usize) -> Option<&mut [u8]>

Returns a remaining_mut slice containing the last len bytes of the buffer. Read more
Source§

fn split_at_mut(&mut self, mid: usize) -> (&mut [u8], &mut [u8])

Divides the buffer into two remaining_mut slices at the given index. Read more
Source§

fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut [u8], &mut [u8])>

Divides the buffer into two remaining_mut slices at the given index. Read more
Source§

fn write_slice(&mut self, slice: &[u8]) -> usize

Writes slice of bytes to the beginning of the buffer and advances the internal cursor. Read more
Source§

fn write_slice_checked(&mut self, slice: &[u8]) -> Option<usize>

Tries to write slice of bytes to the beginning of the buffer and advance the internal cursor. Read more
Source§

fn try_write_slice(&mut self, slice: &[u8]) -> Result<usize, TryWriteError>

Tries to write slice of bytes to the beginning of the buffer and advance the internal cursor. Read more
Source§

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

Writes u16 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u16_le_checked(&mut self, value: u16) -> Option<usize>

Tries to write u16 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u16_le(&mut self, value: u16) -> Result<usize, TryWriteError>

Tries to write u16 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes u16 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u16_be_checked(&mut self, value: u16) -> Option<usize>

Tries to write u16 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u16_be(&mut self, value: u16) -> Result<usize, TryWriteError>

Tries to write u16 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u16_ne(&mut self, value: u16) -> usize

Writes u16 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u16_ne_checked(&mut self, value: u16) -> Option<usize>

Tries to write u16 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u16_ne(&mut self, value: u16) -> Result<usize, TryWriteError>

Tries to write u16 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes u32 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u32_le_checked(&mut self, value: u32) -> Option<usize>

Tries to write u32 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u32_le(&mut self, value: u32) -> Result<usize, TryWriteError>

Tries to write u32 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes u32 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u32_be_checked(&mut self, value: u32) -> Option<usize>

Tries to write u32 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u32_be(&mut self, value: u32) -> Result<usize, TryWriteError>

Tries to write u32 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u32_ne(&mut self, value: u32) -> usize

Writes u32 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u32_ne_checked(&mut self, value: u32) -> Option<usize>

Tries to write u32 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u32_ne(&mut self, value: u32) -> Result<usize, TryWriteError>

Tries to write u32 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes u64 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u64_le_checked(&mut self, value: u64) -> Option<usize>

Tries to write u64 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u64_le(&mut self, value: u64) -> Result<usize, TryWriteError>

Tries to write u64 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes u64 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u64_be_checked(&mut self, value: u64) -> Option<usize>

Tries to write u64 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u64_be(&mut self, value: u64) -> Result<usize, TryWriteError>

Tries to write u64 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u64_ne(&mut self, value: u64) -> usize

Writes u64 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u64_ne_checked(&mut self, value: u64) -> Option<usize>

Tries to write u64 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u64_ne(&mut self, value: u64) -> Result<usize, TryWriteError>

Tries to write u64 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes u128 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u128_le_checked(&mut self, value: u128) -> Option<usize>

Tries to write u128 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u128_le(&mut self, value: u128) -> Result<usize, TryWriteError>

Tries to write u128 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes u128 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u128_be_checked(&mut self, value: u128) -> Option<usize>

Tries to write u128 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u128_be(&mut self, value: u128) -> Result<usize, TryWriteError>

Tries to write u128 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u128_ne(&mut self, value: u128) -> usize

Writes u128 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_u128_ne_checked(&mut self, value: u128) -> Option<usize>

Tries to write u128 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_u128_ne(&mut self, value: u128) -> Result<usize, TryWriteError>

Tries to write u128 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes i16 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i16_le_checked(&mut self, value: i16) -> Option<usize>

Tries to write i16 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i16_le(&mut self, value: i16) -> Result<usize, TryWriteError>

Tries to write i16 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes i16 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i16_be_checked(&mut self, value: i16) -> Option<usize>

Tries to write i16 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i16_be(&mut self, value: i16) -> Result<usize, TryWriteError>

Tries to write i16 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i16_ne(&mut self, value: i16) -> usize

Writes i16 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i16_ne_checked(&mut self, value: i16) -> Option<usize>

Tries to write i16 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i16_ne(&mut self, value: i16) -> Result<usize, TryWriteError>

Tries to write i16 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes i32 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i32_le_checked(&mut self, value: i32) -> Option<usize>

Tries to write i32 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i32_le(&mut self, value: i32) -> Result<usize, TryWriteError>

Tries to write i32 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes i32 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i32_be_checked(&mut self, value: i32) -> Option<usize>

Tries to write i32 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i32_be(&mut self, value: i32) -> Result<usize, TryWriteError>

Tries to write i32 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i32_ne(&mut self, value: i32) -> usize

Writes i32 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i32_ne_checked(&mut self, value: i32) -> Option<usize>

Tries to write i32 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i32_ne(&mut self, value: i32) -> Result<usize, TryWriteError>

Tries to write i32 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes i64 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i64_le_checked(&mut self, value: i64) -> Option<usize>

Tries to write i64 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i64_le(&mut self, value: i64) -> Result<usize, TryWriteError>

Tries to write i64 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes i64 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i64_be_checked(&mut self, value: i64) -> Option<usize>

Tries to write i64 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i64_be(&mut self, value: i64) -> Result<usize, TryWriteError>

Tries to write i64 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i64_ne(&mut self, value: i64) -> usize

Writes i64 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i64_ne_checked(&mut self, value: i64) -> Option<usize>

Tries to write i64 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i64_ne(&mut self, value: i64) -> Result<usize, TryWriteError>

Tries to write i64 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes i128 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i128_le_checked(&mut self, value: i128) -> Option<usize>

Tries to write i128 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i128_le(&mut self, value: i128) -> Result<usize, TryWriteError>

Tries to write i128 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes i128 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i128_be_checked(&mut self, value: i128) -> Option<usize>

Tries to write i128 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i128_be(&mut self, value: i128) -> Result<usize, TryWriteError>

Tries to write i128 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i128_ne(&mut self, value: i128) -> usize

Writes i128 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_i128_ne_checked(&mut self, value: i128) -> Option<usize>

Tries to write i128 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_i128_ne(&mut self, value: i128) -> Result<usize, TryWriteError>

Tries to write i128 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes f32 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_f32_le_checked(&mut self, value: f32) -> Option<usize>

Tries to write f32 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_f32_le(&mut self, value: f32) -> Result<usize, TryWriteError>

Tries to write f32 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes f32 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_f32_be_checked(&mut self, value: f32) -> Option<usize>

Tries to write f32 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_f32_be(&mut self, value: f32) -> Result<usize, TryWriteError>

Tries to write f32 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_f32_ne(&mut self, value: f32) -> usize

Writes f32 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_f32_ne_checked(&mut self, value: f32) -> Option<usize>

Tries to write f32 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_f32_ne(&mut self, value: f32) -> Result<usize, TryWriteError>

Tries to write f32 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes f64 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_f64_le_checked(&mut self, value: f64) -> Option<usize>

Tries to write f64 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_f64_le(&mut self, value: f64) -> Result<usize, TryWriteError>

Tries to write f64 value in little-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes f64 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_f64_be_checked(&mut self, value: f64) -> Option<usize>

Tries to write f64 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_f64_be(&mut self, value: f64) -> Result<usize, TryWriteError>

Tries to write f64 value in big-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_f64_ne(&mut self, value: f64) -> usize

Writes f64 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn write_f64_ne_checked(&mut self, value: f64) -> Option<usize>

Tries to write f64 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

fn try_write_f64_ne(&mut self, value: f64) -> Result<usize, TryWriteError>

Tries to write f64 value in native-endian byte order to the beginning of the buffer, advancing the internal cursor. Read more
Source§

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

Writes u8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn write_u8_checked(&mut self, value: u8) -> Option<usize>

Tries to write u8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

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

Writes i8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn write_i8_checked(&mut self, value: i8) -> Option<usize>

Tries to write i8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_write_u8(&mut self, value: u8) -> Result<usize, TryWriteError>

Tries to write u8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_write_i8(&mut self, value: i8) -> Result<usize, TryWriteError>

Tries to write i8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_slice(&mut self, slice: &[u8]) -> usize

Puts slice of bytes to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_slice_checked(&mut self, slice: &[u8]) -> Option<usize>

Tries to put slice of bytes to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_slice(&mut self, slice: &[u8]) -> Result<usize, TryPutError>

Tries to put slice of bytes to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_slice_at(&mut self, slice: &[u8], offset: usize) -> usize

Puts slice of bytes to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_slice_at_checked(&mut self, slice: &[u8], offset: usize) -> Option<usize>

Tries to put slice of bytes to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_slice_at( &mut self, slice: &[u8], offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put slice of bytes to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u16_le_at(&mut self, value: u16, offset: usize) -> usize

Puts a u16 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u16_le_at_checked(&mut self, value: u16, offset: usize) -> Option<usize>

Tries to put u16 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u16_le_at( &mut self, value: u16, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u16 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u16_be_at(&mut self, value: u16, offset: usize) -> usize

Puts u16 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u16_be_at_checked(&mut self, value: u16, offset: usize) -> Option<usize>

Tries to put u16 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u16_be_at( &mut self, value: u16, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u16 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u16_ne_at(&mut self, value: u16, offset: usize) -> usize

Puts u16 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u16_ne_at_checked(&mut self, value: u16, offset: usize) -> Option<usize>

Tries to put u16 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u16_ne_at( &mut self, value: u16, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u16 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u16_le(&mut self, value: u16) -> usize

Puts u16 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u16_le_checked(&mut self, value: u16) -> Option<usize>

Tries to put u16 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u16_le(&mut self, value: u16) -> Result<usize, TryPutError>

Tries to put u16 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u16_be(&mut self, value: u16) -> usize

Puts a u16 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u16_be_checked(&mut self, value: u16) -> Option<usize>

Tries to put u16 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u16_be(&mut self, value: u16) -> Result<usize, TryPutError>

Tries to put u16 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u16_ne(&mut self, value: u16) -> usize

Puts u16 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u16_ne_checked(&mut self, value: u16) -> Option<usize>

Tries to put u16 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u16_ne(&mut self, value: u16) -> Result<usize, TryPutError>

Tries to put u16 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u32_le_at(&mut self, value: u32, offset: usize) -> usize

Puts a u32 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u32_le_at_checked(&mut self, value: u32, offset: usize) -> Option<usize>

Tries to put u32 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u32_le_at( &mut self, value: u32, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u32 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u32_be_at(&mut self, value: u32, offset: usize) -> usize

Puts u32 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u32_be_at_checked(&mut self, value: u32, offset: usize) -> Option<usize>

Tries to put u32 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u32_be_at( &mut self, value: u32, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u32 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u32_ne_at(&mut self, value: u32, offset: usize) -> usize

Puts u32 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u32_ne_at_checked(&mut self, value: u32, offset: usize) -> Option<usize>

Tries to put u32 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u32_ne_at( &mut self, value: u32, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u32 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u32_le(&mut self, value: u32) -> usize

Puts u32 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u32_le_checked(&mut self, value: u32) -> Option<usize>

Tries to put u32 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u32_le(&mut self, value: u32) -> Result<usize, TryPutError>

Tries to put u32 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u32_be(&mut self, value: u32) -> usize

Puts a u32 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u32_be_checked(&mut self, value: u32) -> Option<usize>

Tries to put u32 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u32_be(&mut self, value: u32) -> Result<usize, TryPutError>

Tries to put u32 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u32_ne(&mut self, value: u32) -> usize

Puts u32 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u32_ne_checked(&mut self, value: u32) -> Option<usize>

Tries to put u32 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u32_ne(&mut self, value: u32) -> Result<usize, TryPutError>

Tries to put u32 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u64_le_at(&mut self, value: u64, offset: usize) -> usize

Puts a u64 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u64_le_at_checked(&mut self, value: u64, offset: usize) -> Option<usize>

Tries to put u64 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u64_le_at( &mut self, value: u64, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u64 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u64_be_at(&mut self, value: u64, offset: usize) -> usize

Puts u64 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u64_be_at_checked(&mut self, value: u64, offset: usize) -> Option<usize>

Tries to put u64 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u64_be_at( &mut self, value: u64, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u64 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u64_ne_at(&mut self, value: u64, offset: usize) -> usize

Puts u64 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u64_ne_at_checked(&mut self, value: u64, offset: usize) -> Option<usize>

Tries to put u64 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u64_ne_at( &mut self, value: u64, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u64 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u64_le(&mut self, value: u64) -> usize

Puts u64 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u64_le_checked(&mut self, value: u64) -> Option<usize>

Tries to put u64 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u64_le(&mut self, value: u64) -> Result<usize, TryPutError>

Tries to put u64 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u64_be(&mut self, value: u64) -> usize

Puts a u64 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u64_be_checked(&mut self, value: u64) -> Option<usize>

Tries to put u64 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u64_be(&mut self, value: u64) -> Result<usize, TryPutError>

Tries to put u64 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u64_ne(&mut self, value: u64) -> usize

Puts u64 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u64_ne_checked(&mut self, value: u64) -> Option<usize>

Tries to put u64 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u64_ne(&mut self, value: u64) -> Result<usize, TryPutError>

Tries to put u64 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u128_le_at(&mut self, value: u128, offset: usize) -> usize

Puts a u128 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u128_le_at_checked( &mut self, value: u128, offset: usize, ) -> Option<usize>

Tries to put u128 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u128_le_at( &mut self, value: u128, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u128 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u128_be_at(&mut self, value: u128, offset: usize) -> usize

Puts u128 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u128_be_at_checked( &mut self, value: u128, offset: usize, ) -> Option<usize>

Tries to put u128 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u128_be_at( &mut self, value: u128, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u128 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u128_ne_at(&mut self, value: u128, offset: usize) -> usize

Puts u128 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u128_ne_at_checked( &mut self, value: u128, offset: usize, ) -> Option<usize>

Tries to put u128 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u128_ne_at( &mut self, value: u128, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u128 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u128_le(&mut self, value: u128) -> usize

Puts u128 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u128_le_checked(&mut self, value: u128) -> Option<usize>

Tries to put u128 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u128_le(&mut self, value: u128) -> Result<usize, TryPutError>

Tries to put u128 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u128_be(&mut self, value: u128) -> usize

Puts a u128 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u128_be_checked(&mut self, value: u128) -> Option<usize>

Tries to put u128 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u128_be(&mut self, value: u128) -> Result<usize, TryPutError>

Tries to put u128 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u128_ne(&mut self, value: u128) -> usize

Puts u128 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u128_ne_checked(&mut self, value: u128) -> Option<usize>

Tries to put u128 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u128_ne(&mut self, value: u128) -> Result<usize, TryPutError>

Tries to put u128 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i16_le_at(&mut self, value: i16, offset: usize) -> usize

Puts a i16 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i16_le_at_checked(&mut self, value: i16, offset: usize) -> Option<usize>

Tries to put i16 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i16_le_at( &mut self, value: i16, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i16 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i16_be_at(&mut self, value: i16, offset: usize) -> usize

Puts i16 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i16_be_at_checked(&mut self, value: i16, offset: usize) -> Option<usize>

Tries to put i16 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i16_be_at( &mut self, value: i16, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i16 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i16_ne_at(&mut self, value: i16, offset: usize) -> usize

Puts i16 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i16_ne_at_checked(&mut self, value: i16, offset: usize) -> Option<usize>

Tries to put i16 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i16_ne_at( &mut self, value: i16, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i16 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i16_le(&mut self, value: i16) -> usize

Puts i16 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i16_le_checked(&mut self, value: i16) -> Option<usize>

Tries to put i16 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i16_le(&mut self, value: i16) -> Result<usize, TryPutError>

Tries to put i16 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i16_be(&mut self, value: i16) -> usize

Puts a i16 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i16_be_checked(&mut self, value: i16) -> Option<usize>

Tries to put i16 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i16_be(&mut self, value: i16) -> Result<usize, TryPutError>

Tries to put i16 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i16_ne(&mut self, value: i16) -> usize

Puts i16 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i16_ne_checked(&mut self, value: i16) -> Option<usize>

Tries to put i16 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i16_ne(&mut self, value: i16) -> Result<usize, TryPutError>

Tries to put i16 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i32_le_at(&mut self, value: i32, offset: usize) -> usize

Puts a i32 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i32_le_at_checked(&mut self, value: i32, offset: usize) -> Option<usize>

Tries to put i32 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i32_le_at( &mut self, value: i32, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i32 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i32_be_at(&mut self, value: i32, offset: usize) -> usize

Puts i32 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i32_be_at_checked(&mut self, value: i32, offset: usize) -> Option<usize>

Tries to put i32 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i32_be_at( &mut self, value: i32, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i32 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i32_ne_at(&mut self, value: i32, offset: usize) -> usize

Puts i32 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i32_ne_at_checked(&mut self, value: i32, offset: usize) -> Option<usize>

Tries to put i32 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i32_ne_at( &mut self, value: i32, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i32 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i32_le(&mut self, value: i32) -> usize

Puts i32 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i32_le_checked(&mut self, value: i32) -> Option<usize>

Tries to put i32 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i32_le(&mut self, value: i32) -> Result<usize, TryPutError>

Tries to put i32 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i32_be(&mut self, value: i32) -> usize

Puts a i32 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i32_be_checked(&mut self, value: i32) -> Option<usize>

Tries to put i32 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i32_be(&mut self, value: i32) -> Result<usize, TryPutError>

Tries to put i32 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i32_ne(&mut self, value: i32) -> usize

Puts i32 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i32_ne_checked(&mut self, value: i32) -> Option<usize>

Tries to put i32 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i32_ne(&mut self, value: i32) -> Result<usize, TryPutError>

Tries to put i32 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i64_le_at(&mut self, value: i64, offset: usize) -> usize

Puts a i64 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i64_le_at_checked(&mut self, value: i64, offset: usize) -> Option<usize>

Tries to put i64 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i64_le_at( &mut self, value: i64, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i64 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i64_be_at(&mut self, value: i64, offset: usize) -> usize

Puts i64 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i64_be_at_checked(&mut self, value: i64, offset: usize) -> Option<usize>

Tries to put i64 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i64_be_at( &mut self, value: i64, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i64 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i64_ne_at(&mut self, value: i64, offset: usize) -> usize

Puts i64 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i64_ne_at_checked(&mut self, value: i64, offset: usize) -> Option<usize>

Tries to put i64 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i64_ne_at( &mut self, value: i64, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i64 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i64_le(&mut self, value: i64) -> usize

Puts i64 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i64_le_checked(&mut self, value: i64) -> Option<usize>

Tries to put i64 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i64_le(&mut self, value: i64) -> Result<usize, TryPutError>

Tries to put i64 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i64_be(&mut self, value: i64) -> usize

Puts a i64 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i64_be_checked(&mut self, value: i64) -> Option<usize>

Tries to put i64 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i64_be(&mut self, value: i64) -> Result<usize, TryPutError>

Tries to put i64 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i64_ne(&mut self, value: i64) -> usize

Puts i64 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i64_ne_checked(&mut self, value: i64) -> Option<usize>

Tries to put i64 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i64_ne(&mut self, value: i64) -> Result<usize, TryPutError>

Tries to put i64 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i128_le_at(&mut self, value: i128, offset: usize) -> usize

Puts a i128 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i128_le_at_checked( &mut self, value: i128, offset: usize, ) -> Option<usize>

Tries to put i128 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i128_le_at( &mut self, value: i128, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i128 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i128_be_at(&mut self, value: i128, offset: usize) -> usize

Puts i128 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i128_be_at_checked( &mut self, value: i128, offset: usize, ) -> Option<usize>

Tries to put i128 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i128_be_at( &mut self, value: i128, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i128 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i128_ne_at(&mut self, value: i128, offset: usize) -> usize

Puts i128 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i128_ne_at_checked( &mut self, value: i128, offset: usize, ) -> Option<usize>

Tries to put i128 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i128_ne_at( &mut self, value: i128, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i128 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i128_le(&mut self, value: i128) -> usize

Puts i128 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i128_le_checked(&mut self, value: i128) -> Option<usize>

Tries to put i128 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i128_le(&mut self, value: i128) -> Result<usize, TryPutError>

Tries to put i128 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i128_be(&mut self, value: i128) -> usize

Puts a i128 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i128_be_checked(&mut self, value: i128) -> Option<usize>

Tries to put i128 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i128_be(&mut self, value: i128) -> Result<usize, TryPutError>

Tries to put i128 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i128_ne(&mut self, value: i128) -> usize

Puts i128 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i128_ne_checked(&mut self, value: i128) -> Option<usize>

Tries to put i128 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i128_ne(&mut self, value: i128) -> Result<usize, TryPutError>

Tries to put i128 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f32_le_at(&mut self, value: f32, offset: usize) -> usize

Puts a f32 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f32_le_at_checked(&mut self, value: f32, offset: usize) -> Option<usize>

Tries to put f32 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_f32_le_at( &mut self, value: f32, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put f32 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f32_be_at(&mut self, value: f32, offset: usize) -> usize

Puts f32 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f32_be_at_checked(&mut self, value: f32, offset: usize) -> Option<usize>

Tries to put f32 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_f32_be_at( &mut self, value: f32, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put f32 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f32_ne_at(&mut self, value: f32, offset: usize) -> usize

Puts f32 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f32_ne_at_checked(&mut self, value: f32, offset: usize) -> Option<usize>

Tries to put f32 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_f32_ne_at( &mut self, value: f32, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put f32 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f32_le(&mut self, value: f32) -> usize

Puts f32 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f32_le_checked(&mut self, value: f32) -> Option<usize>

Tries to put f32 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_f32_le(&mut self, value: f32) -> Result<usize, TryPutError>

Tries to put f32 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f32_be(&mut self, value: f32) -> usize

Puts a f32 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f32_be_checked(&mut self, value: f32) -> Option<usize>

Tries to put f32 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_f32_be(&mut self, value: f32) -> Result<usize, TryPutError>

Tries to put f32 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f32_ne(&mut self, value: f32) -> usize

Puts f32 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f32_ne_checked(&mut self, value: f32) -> Option<usize>

Tries to put f32 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_f32_ne(&mut self, value: f32) -> Result<usize, TryPutError>

Tries to put f32 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f64_le_at(&mut self, value: f64, offset: usize) -> usize

Puts a f64 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f64_le_at_checked(&mut self, value: f64, offset: usize) -> Option<usize>

Tries to put f64 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_f64_le_at( &mut self, value: f64, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put f64 value in little-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f64_be_at(&mut self, value: f64, offset: usize) -> usize

Puts f64 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f64_be_at_checked(&mut self, value: f64, offset: usize) -> Option<usize>

Tries to put f64 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_f64_be_at( &mut self, value: f64, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put f64 value in big-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f64_ne_at(&mut self, value: f64, offset: usize) -> usize

Puts f64 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f64_ne_at_checked(&mut self, value: f64, offset: usize) -> Option<usize>

Tries to put f64 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_f64_ne_at( &mut self, value: f64, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put f64 value in native-endian byte order to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_f64_le(&mut self, value: f64) -> usize

Puts f64 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f64_le_checked(&mut self, value: f64) -> Option<usize>

Tries to put f64 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_f64_le(&mut self, value: f64) -> Result<usize, TryPutError>

Tries to put f64 value in little-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f64_be(&mut self, value: f64) -> usize

Puts a f64 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f64_be_checked(&mut self, value: f64) -> Option<usize>

Tries to put f64 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_f64_be(&mut self, value: f64) -> Result<usize, TryPutError>

Tries to put f64 value in big-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f64_ne(&mut self, value: f64) -> usize

Puts f64 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_f64_ne_checked(&mut self, value: f64) -> Option<usize>

Tries to put f64 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_f64_ne(&mut self, value: f64) -> Result<usize, TryPutError>

Tries to put f64 value in native-endian byte order to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u8(&mut self, value: u8) -> usize

Puts u8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u8_checked(&mut self, value: u8) -> Option<usize>

Tries to put u8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i8(&mut self, value: i8) -> usize

Puts i8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_i8_checked(&mut self, value: i8) -> Option<usize>

Tries to put i8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn put_u8_at(&mut self, value: u8, offset: usize) -> usize

Puts u8 value to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_u8_at_checked(&mut self, value: u8, offset: usize) -> Option<usize>

Tries to put u8 value to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i8_at(&mut self, value: i8, offset: usize) -> usize

Puts i8 value to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn put_i8_at_checked(&mut self, value: i8, offset: usize) -> Option<usize>

Tries to put i8 value to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_u8(&mut self, value: u8) -> Result<usize, TryPutError>

Tries to put u8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_i8(&mut self, value: i8) -> Result<usize, TryPutError>

Tries to put i8 value to the beginning of the buffer without advancing the internal cursor. Read more
Source§

fn try_put_u8_at( &mut self, value: u8, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put u8 value to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn try_put_i8_at( &mut self, value: i8, offset: usize, ) -> Result<usize, TryPutAtError>

Tries to put i8 value to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

impl<B: Debug + ?Sized> Debug for Putter<B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B: BufMut> From<B> for Putter<B>

Source§

fn from(buf: B) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<B> Freeze for Putter<B>
where B: Freeze + ?Sized,

§

impl<B> RefUnwindSafe for Putter<B>
where B: RefUnwindSafe + ?Sized,

§

impl<B> Send for Putter<B>
where B: Send + ?Sized,

§

impl<B> Sync for Putter<B>
where B: Sync + ?Sized,

§

impl<B> Unpin for Putter<B>
where B: Unpin + ?Sized,

§

impl<B> UnwindSafe for Putter<B>
where B: UnwindSafe + ?Sized,

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> BufMutExt for T
where T: BufMut,

Source§

fn put_varint<V>(&mut self, value: &V) -> Result<usize, PutVarintError>
where V: Varint,

Available on crate feature varing only.
Puts type in LEB128 format to the buffer without advancing the internal cursor. Read more
Source§

fn put_varint_at<V>( &mut self, value: &V, offset: usize, ) -> Result<usize, PutVarintAtError>
where V: Varint,

Available on crate feature varing only.
Puts type in LEB128 format to the buffer at the specified offset without advancing the internal cursor. Read more
Source§

fn write_varint<V>(&mut self, value: &V) -> Result<usize, WriteVarintError>
where V: Varint,

Available on crate feature varing only.
Writes type in LEB128 format to the buffer without advancing the internal cursor. 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.