pub struct AlignedBuffer<const N: usize> { /* private fields */ }Expand description
Cache-line aligned buffer for optimal CPU cache performance.
The buffer is aligned to 64 bytes (typical cache line size) to prevent false sharing and ensure optimal memory access patterns.
§Type Parameters
N- Buffer size in bytes
Implementations§
Trait Implementations§
Source§impl<const N: usize> Clone for AlignedBuffer<N>
impl<const N: usize> Clone for AlignedBuffer<N>
Source§fn clone(&self) -> AlignedBuffer<N>
fn clone(&self) -> AlignedBuffer<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const N: usize> Debug for AlignedBuffer<N>
impl<const N: usize> Debug for AlignedBuffer<N>
Source§impl<const N: usize> Default for AlignedBuffer<N>
impl<const N: usize> Default for AlignedBuffer<N>
Source§impl<const N: usize> ReadBuffer for AlignedBuffer<N>
impl<const N: usize> ReadBuffer for AlignedBuffer<N>
Source§fn get_u16_le(&self, offset: usize) -> u16
fn get_u16_le(&self, offset: usize) -> u16
Reads a u16 in little-endian at the given offset. Read more
Source§fn get_i16_le(&self, offset: usize) -> i16
fn get_i16_le(&self, offset: usize) -> i16
Reads an i16 in little-endian at the given offset. Read more
Source§fn get_u32_le(&self, offset: usize) -> u32
fn get_u32_le(&self, offset: usize) -> u32
Reads a u32 in little-endian at the given offset. Read more
Source§fn get_i32_le(&self, offset: usize) -> i32
fn get_i32_le(&self, offset: usize) -> i32
Reads an i32 in little-endian at the given offset. Read more
Source§fn get_u64_le(&self, offset: usize) -> u64
fn get_u64_le(&self, offset: usize) -> u64
Reads a u64 in little-endian at the given offset. Read more
Source§fn get_i64_le(&self, offset: usize) -> i64
fn get_i64_le(&self, offset: usize) -> i64
Reads an i64 in little-endian at the given offset. Read more
Source§fn get_f32_le(&self, offset: usize) -> f32
fn get_f32_le(&self, offset: usize) -> f32
Reads an f32 in little-endian at the given offset. Read more
Source§fn get_f64_le(&self, offset: usize) -> f64
fn get_f64_le(&self, offset: usize) -> f64
Reads an f64 in little-endian at the given offset. Read more
Source§impl<const N: usize> WriteBuffer for AlignedBuffer<N>
impl<const N: usize> WriteBuffer for AlignedBuffer<N>
Source§fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Returns the buffer as a mutable byte slice.
Source§fn put_u16_le(&mut self, offset: usize, value: u16)
fn put_u16_le(&mut self, offset: usize, value: u16)
Writes a u16 in little-endian at the given offset. Read more
Source§fn put_i16_le(&mut self, offset: usize, value: i16)
fn put_i16_le(&mut self, offset: usize, value: i16)
Writes an i16 in little-endian at the given offset. Read more
Source§fn put_u32_le(&mut self, offset: usize, value: u32)
fn put_u32_le(&mut self, offset: usize, value: u32)
Writes a u32 in little-endian at the given offset. Read more
Source§fn put_i32_le(&mut self, offset: usize, value: i32)
fn put_i32_le(&mut self, offset: usize, value: i32)
Writes an i32 in little-endian at the given offset. Read more
Source§fn put_u64_le(&mut self, offset: usize, value: u64)
fn put_u64_le(&mut self, offset: usize, value: u64)
Writes a u64 in little-endian at the given offset. Read more
Source§fn put_i64_le(&mut self, offset: usize, value: i64)
fn put_i64_le(&mut self, offset: usize, value: i64)
Writes an i64 in little-endian at the given offset. Read more
Source§fn put_f32_le(&mut self, offset: usize, value: f32)
fn put_f32_le(&mut self, offset: usize, value: f32)
Writes an f32 in little-endian at the given offset. Read more
Source§fn put_f64_le(&mut self, offset: usize, value: f64)
fn put_f64_le(&mut self, offset: usize, value: f64)
Writes an f64 in little-endian at the given offset. Read more
Source§fn put_bytes(&mut self, offset: usize, src: &[u8])
fn put_bytes(&mut self, offset: usize, src: &[u8])
Writes a byte slice at the given offset. Read more
Auto Trait Implementations§
impl<const N: usize> Freeze for AlignedBuffer<N>
impl<const N: usize> RefUnwindSafe for AlignedBuffer<N>
impl<const N: usize> Send for AlignedBuffer<N>
impl<const N: usize> Sync for AlignedBuffer<N>
impl<const N: usize> Unpin for AlignedBuffer<N>
impl<const N: usize> UnwindSafe for AlignedBuffer<N>
Blanket Implementations§
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