pub struct Fdt<'a> { /* private fields */ }
Implementations§
Source§impl<'a> Fdt<'a>
impl<'a> Fdt<'a>
Sourcepub fn from_bytes(data: &'a [u8]) -> Result<Fdt<'a>, FdtError>
pub fn from_bytes(data: &'a [u8]) -> Result<Fdt<'a>, FdtError>
Create a new Fdt
from byte slice.
Sourcepub unsafe fn from_ptr(ptr: *mut u8) -> Result<Fdt<'a>, FdtError>
pub unsafe fn from_ptr(ptr: *mut u8) -> Result<Fdt<'a>, FdtError>
Create a new Fdt
from a raw pointer and size in bytes.
§Safety
The caller must ensure that the pointer is valid and points to a
memory region of at least size
bytes that contains a valid device tree
blob.
pub fn as_slice(&self) -> &'a [u8]
pub fn total_size(&self) -> usize
Sourcepub fn boot_cpuid_phys(&self) -> u32
pub fn boot_cpuid_phys(&self) -> u32
This field shall contain the physical ID of the system’s boot CPU. It shall be identical to the physical ID given in the reg property of that CPU node within the devicetree.
pub fn memory_reservation_blocks( &self, ) -> impl Iterator<Item = MemoryRegion> + 'a
pub fn all_nodes(&self) -> NodeIter<'a, 16> ⓘ
Sourcepub fn find_nodes(
&self,
path: &'a str,
) -> impl Iterator<Item = Result<Node<'a>, FdtError>> + 'a
pub fn find_nodes( &self, path: &'a str, ) -> impl Iterator<Item = Result<Node<'a>, FdtError>> + 'a
if path start with ‘/’ then search by path, else search by aliases
pub fn find_aliase(&self, name: &str) -> Result<&'a str, FdtError>
pub fn find_compatible<'b, 'c: 'b>( &'b self, with: &'c [&'c str], ) -> impl Iterator<Item = Result<Node<'a>, FdtError>> + 'b
pub fn chosen(&self) -> Result<Chosen<'a>, FdtError>
pub fn get_node_by_phandle( &self, phandle: Phandle, ) -> Result<Node<'a>, FdtError>
pub fn get_node_by_name(&'a self, name: &str) -> Result<Node<'a>, FdtError>
pub fn memory( &'a self, ) -> impl Iterator<Item = Result<Memory<'a>, FdtError>> + 'a
Sourcepub fn reserved_memory_regions(
&self,
) -> Result<ReservedMemoryRegionsIter<'a>, FdtError>
pub fn reserved_memory_regions( &self, ) -> Result<ReservedMemoryRegionsIter<'a>, FdtError>
Get all reserved-memory child nodes (memory regions)
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Fdt<'a>
impl<'a> RefUnwindSafe for Fdt<'a>
impl<'a> Send for Fdt<'a>
impl<'a> Sync for Fdt<'a>
impl<'a> Unpin for Fdt<'a>
impl<'a> UnwindSafe for Fdt<'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