[][src]Trait fdt_rs::prelude::PropReader

pub trait PropReader<'dt> {
    type NodeType;
    fn node(&self) -> Self::NodeType;

    fn name(&self) -> Result<&'dt str> { ... }
#[must_use] fn length(&self) -> usize { ... }
fn u32(&self, index: usize) -> Result<u32> { ... }
fn u64(&self, index: usize) -> Result<u64> { ... }
fn phandle(&self, index: usize) -> Result<Phandle> { ... }
fn str(&self) -> Result<&'dt str> { ... }
fn iter_str(&self) -> StringPropIter<'dt> { ... }
fn raw(&self) -> &'dt [u8] { ... } }

Associated Types

Loading content...

Required methods

fn node(&self) -> Self::NodeType

Returns the node which this property is contained within.

Loading content...

Provided methods

fn name(&self) -> Result<&'dt str>

Returns the name of the property within the device tree.

#[must_use]fn length(&self) -> usize

Returns the length of the property value within the device tree

fn u32(&self, index: usize) -> Result<u32>

Read a big-endian u32 from the provided offset in this device tree property's value. Convert the read value into the machines' native u32 format and return it.

If an offset which would cause this read to access memory outside of this property's value an Err containing DevTreeError::InvalidOffset will be returned.

fn u64(&self, index: usize) -> Result<u64>

Read a big-endian u64 from the provided offset in this device tree property's value. Convert the read value into the machines' native u64 format and return it.

If an offset which would cause this read to access memory outside of this property's value an Err containing DevTreeError::InvalidOffset will be returned.

fn phandle(&self, index: usize) -> Result<Phandle>

A Phandle is simply defined as a u32 value, as such this method performs the same action as [self.u32]

fn str(&self) -> Result<&'dt str>

Returns the string property as a string if it can be parsed as one.

Safety

See the safety note of PropReader::u32

fn iter_str(&self) -> StringPropIter<'dt>

Returns the property as a string fallible_iterator.

Safety

See the safety note of PropReader::u32

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

Returns this property's data as a raw slice

Safety

See the safety note of [PropReader::get_u32]

Loading content...

Implementors

impl<'a, 'i: 'a, 'dt: 'i> PropReader<'dt> for DevTreeIndexProp<'a, 'i, 'dt>[src]

type NodeType = DevTreeIndexNode<'a, 'i, 'dt>

impl<'r, 'dt: 'r> PropReader<'dt> for DevTreeProp<'r, 'dt>[src]

type NodeType = DevTreeNode<'r, 'dt>

#[must_use]fn node(&self) -> DevTreeNode<'r, 'dt>[src]

Returns the node which this property is attached to

Loading content...