pub struct Reader<'a> { /* private fields */ }Expand description
A zero-allocation reader for the communication channel.
The Reader provides methods to read primitive values and arrays from a shared
memory buffer. It maintains proper alignment for different data types and tracks
the current offset position.
§Examples
let mut storage = vec![0u64; 1024];
let mut reader = Reader::from(&mut storage);
let value = reader.read_u32();
let pi = reader.read_f64();
let array = reader.read_array_i32();Implementations§
Source§impl<'a> Reader<'a>
impl<'a> Reader<'a>
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Resets the reader to the beginning of the buffer.
This allows reusing the same buffer for multiple read operations.
Sourcepub fn read_array_u8(&self) -> &[u8] ⓘ
pub fn read_array_u8(&self) -> &[u8] ⓘ
Sourcepub fn read_elements_u8(&self, length: u32) -> &[u8] ⓘ
pub fn read_elements_u8(&self, length: u32) -> &[u8] ⓘ
Sourcepub fn read_array_u32(&self) -> &[u32]
pub fn read_array_u32(&self) -> &[u32]
Sourcepub fn read_elements_u32(&self, length: u32) -> &[u32]
pub fn read_elements_u32(&self, length: u32) -> &[u32]
Sourcepub fn read_array_i32(&self) -> &[i32]
pub fn read_array_i32(&self) -> &[i32]
Sourcepub fn read_elements_i32(&self, length: u32) -> &[i32]
pub fn read_elements_i32(&self, length: u32) -> &[i32]
Sourcepub fn read_array_f32(&self) -> &[f32]
pub fn read_array_f32(&self) -> &[f32]
Sourcepub fn read_elements_f32(&self, length: u32) -> &[f32]
pub fn read_elements_f32(&self, length: u32) -> &[f32]
Sourcepub fn read_array_f64(&self) -> &[f64]
pub fn read_array_f64(&self) -> &[f64]
Auto Trait Implementations§
impl<'a> !Freeze for Reader<'a>
impl<'a> !RefUnwindSafe for Reader<'a>
impl<'a> !Sync for Reader<'a>
impl<'a> !UnwindSafe for Reader<'a>
impl<'a> Send for Reader<'a>
impl<'a> Unpin for Reader<'a>
impl<'a> UnsafeUnpin for Reader<'a>
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