Struct FdtNode

Source
pub struct FdtNode<'b, 'a: 'b> {
    pub name: &'a str,
    /* private fields */
}
Expand description

A devicetree node

Fields§

§name: &'a str

Implementations§

Source§

impl<'b, 'a: 'b> FdtNode<'b, 'a>

Source

pub fn properties(self) -> impl Iterator<Item = NodeProperty<'a>> + 'b

Returns an iterator over the available properties of the node

Source

pub fn property(self, name: &str) -> Option<NodeProperty<'a>>

Attempts to find the a property by its name

Source

pub fn children(self) -> impl Iterator<Item = FdtNode<'b, 'a>>

Returns an iterator over the children of the current node

Source

pub fn reg(self) -> Option<impl Iterator<Item = MemoryRegion> + 'a>

reg property

Important: this method assumes that the value(s) inside the reg property represent CPU-addressable addresses that are able to fit within the platform’s pointer size (e.g. #address-cells and #size-cells are less than or equal to 2 for a 64-bit platform). If this is not the case or you’re unsure of whether this applies to the node, it is recommended to use the FdtNode::property method to extract the raw value slice or use the provided FdtNode::raw_reg helper method to give you an iterator over the address and size slices. One example of where this would return None for a node is a pci child node which contains the PCI address information in the reg property, of which the address has an #address-cells value of 3.

Source

pub fn raw_reg(self) -> Option<impl Iterator<Item = RawReg<'a>> + 'a>

Convenience method that provides an iterator over the raw bytes for the address and size values inside of the reg property

Source

pub fn compatible(self) -> Option<Compatible<'a>>

compatible property

Source

pub fn cell_sizes(self) -> CellSizes

Cell sizes for child nodes

Source

pub fn interrupt_parent(self) -> Option<FdtNode<'b, 'a>>

Searches for the interrupt parent, if the node contains one

Source

pub fn interrupt_cells(self) -> Option<usize>

#interrupt-cells property

Source

pub fn interrupts(self) -> Option<impl Iterator<Item = usize> + 'a>

interrupts property

Trait Implementations§

Source§

impl<'b, 'a: 'b> Clone for FdtNode<'b, 'a>

Source§

fn clone(&self) -> FdtNode<'b, 'a>

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

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

Performs copy-assignment from source. Read more
Source§

impl<'b, 'a: 'b> Debug for FdtNode<'b, 'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'b, 'a: 'b> Copy for FdtNode<'b, 'a>

Auto Trait Implementations§

§

impl<'b, 'a> Freeze for FdtNode<'b, 'a>

§

impl<'b, 'a> RefUnwindSafe for FdtNode<'b, 'a>

§

impl<'b, 'a> Send for FdtNode<'b, 'a>

§

impl<'b, 'a> Sync for FdtNode<'b, 'a>

§

impl<'b, 'a> Unpin for FdtNode<'b, 'a>

§

impl<'b, 'a> UnwindSafe for FdtNode<'b, '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, 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.