Enum StructureData

Source
pub enum StructureData<'a> {
    BeginNode(&'a str),
    EndNode,
    Property {
        name: &'a str,
        value: Value<'a>,
    },
}
Expand description

An event that signals the start/end of a node or a property of one while walking the device tree.

Variants§

§

BeginNode(&'a str)

Indicates that the following events are within the scope of a new node defined as the child of the previous current node.

§

EndNode

Indicates that the previous current node is complete, and should be popped off the stack and replaced with its parent.

§

Property

Defines a property of the current node

Fields

§name: &'a str

The name of the property.

The Devicetree spec lists a number of common property names, but the system is open for extension, so it may not be recognizable.

§value: Value<'a>

The value of the property.

The format of this data depends on the property name. Types defined by the Devicetree spec include:

  • empty values,
  • null-terminated strings or lists of them,
  • big-endian 32-bit or 64-bit integers
  • “phandles,” or 32-bit numbers that uniquely identify another node

However, different properties can define their own representation, so it is not possible to infer the type of an unrecognized property.

Trait Implementations§

Source§

impl<'a> Clone for StructureData<'a>

Source§

fn clone(&self) -> StructureData<'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<'a> Debug for StructureData<'a>

Source§

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

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

impl<'a> PartialEq for StructureData<'a>

Source§

fn eq(&self, other: &StructureData<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Copy for StructureData<'a>

Source§

impl<'a> Eq for StructureData<'a>

Source§

impl<'a> StructuralPartialEq for StructureData<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for StructureData<'a>

§

impl<'a> RefUnwindSafe for StructureData<'a>

§

impl<'a> Send for StructureData<'a>

§

impl<'a> Sync for StructureData<'a>

§

impl<'a> Unpin for StructureData<'a>

§

impl<'a> UnwindSafe for StructureData<'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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.