Fdt

Struct Fdt 

Source
pub struct Fdt<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Fdt<'a>

Source

pub fn from_bytes(data: &'a [u8]) -> Result<Fdt<'a>, FdtError>

Create a new Fdt from byte slice.

Source

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.

Source

pub fn as_slice(&self) -> &'a [u8]

Source

pub fn header(&self) -> &Header

Get a reference to the FDT header.

Source

pub fn total_size(&self) -> usize

Source

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.

Source

pub fn raw(&self) -> &'a [u8]

Get a reference to the underlying buffer.

Source

pub fn version(&self) -> u32

Get the FDT version

Source

pub fn memory_reservation_blocks( &self, ) -> impl Iterator<Item = MemoryRegion> + 'a

Source

pub fn all_nodes(&self) -> NodeIter<'a, 16>

Source

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

Source

pub fn find_aliase(&self, name: &str) -> Result<&'a str, FdtError>

Source

pub fn find_compatible<'b, 'c: 'b>( &'b self, with: &'c [&'c str], ) -> impl Iterator<Item = Result<Node<'a>, FdtError>> + 'b

Source

pub fn chosen(&self) -> Result<Chosen<'a>, FdtError>

Source

pub fn get_node_by_phandle( &self, phandle: Phandle, ) -> Result<Node<'a>, FdtError>

Source

pub fn get_node_by_name(&'a self, name: &str) -> Result<Node<'a>, FdtError>

Source

pub fn memory( &'a self, ) -> impl Iterator<Item = Result<Memory<'a>, FdtError>> + 'a

Source

pub fn reserved_memory_regions( &self, ) -> Result<ReservedMemoryRegionsIter<'a>, FdtError>

Get all reserved-memory child nodes (memory regions)

Trait Implementations§

Source§

impl<'a> Clone for Fdt<'a>

Source§

fn clone(&self) -> Fdt<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.