[][src]Function fdt_rs::base::parse::next_devtree_token

pub unsafe fn next_devtree_token<'a>(
    buf: &'a [u8],
    off: &mut usize
) -> Result<Option<ParsedTok<'a>>>

This function implements the logic to tokenize the device tree's main structure block.

This function will return the next ParsedTok if one exists. If it succeeds in parsing a token, off will be incremented to the start of the next token within buf.

Safety

  1. The provided buffer must contain a device tree structure block.

  2. The given offset into the buffer, off, must be u32 aligned.

    If this function returns Ok(Some(_)), the offset is guaranteed to be u32 aligned. This means that as long as this function is initially called with an aligned offset, this function may be iteratively called without checking the offset's alignment again.