Node

Enum Node 

Source
pub enum Node<'a> {
    General(NodeBase<'a>),
    Chosen(Chosen<'a>),
    Memory(Memory<'a>),
    InterruptController(InterruptController<'a>),
}

Variants§

§

General(NodeBase<'a>)

§

Chosen(Chosen<'a>)

§

Memory(Memory<'a>)

§

InterruptController(InterruptController<'a>)

Implementations§

Source§

impl<'a> Node<'a>

Source

pub fn node(&self) -> &NodeBase<'a>

Methods from Deref<Target = NodeBase<'a>>§

Source

pub fn parent_name(&self) -> Option<&'a str>

Source

pub fn parent(&self) -> Option<Node<'a>>

Source

pub fn raw(&self) -> Raw<'a>

Source

pub fn name(&self) -> &'a str

Get the name of this node

Source

pub fn level(&self) -> usize

Get the level/depth of this node in the device tree

Source

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

Get compatible strings for this node (placeholder implementation)

Source

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

Source

pub fn reg(&self) -> Result<RegIter<'a>, FdtError>

Source

pub fn is_root(&self) -> bool

检查这个节点是否是根节点

Source

pub fn debug_info(&self) -> NodeDebugInfo<'a>

获取节点的完整路径信息(仅限调试用途)

Source

pub fn properties( &self, ) -> impl Iterator<Item = Result<Property<'a>, FdtError>> + '_

Source

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

Source

pub fn phandle(&self) -> Result<Phandle, FdtError>

Source

pub fn interrupt_parent(&self) -> Result<InterruptController<'a>, FdtError>

Find InterruptController from current node or its parent

Source

pub fn get_interrupt_parent_phandle(&self) -> Option<Phandle>

Get the interrupt parent phandle for this node

Source

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

Source

pub fn clock_frequency(&self) -> Result<u32, FdtError>

Source

pub fn children(&self) -> NodeChildIter<'a>

Source

pub fn status(&self) -> Result<Status, FdtError>

Trait Implementations§

Source§

impl<'a> Clone for Node<'a>

Source§

fn clone(&self) -> Node<'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
Source§

impl<'a> Debug for Node<'a>

Source§

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

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

impl<'a> Deref for Node<'a>

Source§

type Target = NodeBase<'a>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a> From<NodeBase<'a>> for Node<'a>

Source§

fn from(node: NodeBase<'a>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for Node<'a>

§

impl<'a> RefUnwindSafe for Node<'a>

§

impl<'a> Send for Node<'a>

§

impl<'a> Sync for Node<'a>

§

impl<'a> Unpin for Node<'a>

§

impl<'a> UnwindSafe for Node<'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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.