Skip to main content

NodeType

Enum NodeType 

Source
pub enum NodeType<'a> {
    Clock(ClockNodeView<'a>),
    Memory(MemoryNodeView<'a>),
    InterruptController(IntcNodeView<'a>),
    Pci(PciNodeView<'a>),
    Generic(NodeGeneric<'a>),
}
Expand description

Typed node view enum, allowing pattern matching by node kind.

Variants§

§

Clock(ClockNodeView<'a>)

A clock provider node (has #clock-cells property).

§

Memory(MemoryNodeView<'a>)

A memory node (device_type = "memory" or name starts with “memory”).

§

InterruptController(IntcNodeView<'a>)

An interrupt controller node (has the interrupt-controller property).

§

Pci(PciNodeView<'a>)

A PCI bridge node (device_type = "pci").

§

Generic(NodeGeneric<'a>)

A generic node (no special classification).

Implementations§

Source§

impl<'a> NodeType<'a>

Source

pub fn as_node(&self) -> &'a Node

Returns the underlying Node reference.

Source

pub fn path(&self) -> String

Returns the node’s full path string.

Source

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

Source

pub fn id(&self) -> NodeId

Returns the node’s ID.

Source

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

Returns the node’s name.

Source

pub fn regs(&self) -> Vec<RegFixed>

Parses the reg property and returns corrected register entries.

Source

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

Returns the effective interrupt-parent, inheriting from ancestors.

Trait Implementations§

Source§

impl Display for NodeType<'_>

Source§

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

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

impl<'a> From<ClockNodeView<'a>> for NodeType<'a>

Source§

fn from(v: ClockNodeView<'a>) -> NodeType<'a>

Converts to this type from the input type.
Source§

impl<'a> From<IntcNodeView<'a>> for NodeType<'a>

Source§

fn from(v: IntcNodeView<'a>) -> NodeType<'a>

Converts to this type from the input type.
Source§

impl<'a> From<MemoryNodeView<'a>> for NodeType<'a>

Source§

fn from(v: MemoryNodeView<'a>) -> NodeType<'a>

Converts to this type from the input type.
Source§

impl<'a> From<NodeGeneric<'a>> for NodeType<'a>

Source§

fn from(v: NodeGeneric<'a>) -> NodeType<'a>

Converts to this type from the input type.
Source§

impl<'a> From<PciNodeView<'a>> for NodeType<'a>

Source§

fn from(v: PciNodeView<'a>) -> NodeType<'a>

Converts to this type from the input type.
Source§

impl<'a> TryInto<ClockNodeView<'a>> for NodeType<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<ClockNodeView<'a>, <Self as TryInto<ClockNodeView<'a>>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<IntcNodeView<'a>> for NodeType<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<IntcNodeView<'a>, <Self as TryInto<IntcNodeView<'a>>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<MemoryNodeView<'a>> for NodeType<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<MemoryNodeView<'a>, <Self as TryInto<MemoryNodeView<'a>>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<NodeGeneric<'a>> for NodeType<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<NodeGeneric<'a>, <Self as TryInto<NodeGeneric<'a>>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<PciNodeView<'a>> for NodeType<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<PciNodeView<'a>, <Self as TryInto<PciNodeView<'a>>>::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'a> Freeze for NodeType<'a>

§

impl<'a> RefUnwindSafe for NodeType<'a>

§

impl<'a> Send for NodeType<'a>

§

impl<'a> !Sync for NodeType<'a>

§

impl<'a> Unpin for NodeType<'a>

§

impl<'a> UnsafeUnpin for NodeType<'a>

§

impl<'a> UnwindSafe for NodeType<'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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.