pub struct Reader<'a> { /* private fields */ }Expand description
Sequential reader for parsing FDT data structures.
Reader provides sequential read access with position tracking for
parsing FDT binary format. It maintains a current position and can
backtrack if needed.
§Examples
ⓘ
let mut reader = bytes.reader();
let value = reader.read_u32()?;
let str = reader.read_cstr()?;Implementations§
Source§impl<'a> Reader<'a>
impl<'a> Reader<'a>
Sourcepub fn read_bytes(&mut self, size: usize) -> Option<Bytes<'a>>
pub fn read_bytes(&mut self, size: usize) -> Option<Bytes<'a>>
Reads the specified number of bytes, advancing the position.
Returns None if insufficient bytes remain.
Sourcepub fn read_u64(&mut self) -> Option<u64>
pub fn read_u64(&mut self) -> Option<u64>
Reads a big-endian u64 value (composed of two u32 values).
Sourcepub fn read_cells(&mut self, cell_count: usize) -> Option<u64>
pub fn read_cells(&mut self, cell_count: usize) -> Option<u64>
Reads a value composed of the specified number of cells.
Each cell is 4 bytes (a u32). The cells are combined into a u64 value.
Sourcepub fn read_token(&mut self) -> Result<Token, FdtError>
pub fn read_token(&mut self) -> Result<Token, FdtError>
Reads a token from the FDT structure block.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Reader<'a>
impl<'a> RefUnwindSafe for Reader<'a>
impl<'a> Send for Reader<'a>
impl<'a> Sync for Reader<'a>
impl<'a> Unpin for Reader<'a>
impl<'a> UnwindSafe 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