pub trait PropReader<'dt> {
type NodeType;
// Required method
fn node(&self) -> Self::NodeType;
// Provided methods
fn name(&self) -> Result<&'dt str> { ... }
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] ⓘ { ... }
}
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn u32(&self, index: usize) -> Result<u32>
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.
Sourcefn u64(&self, index: usize) -> Result<u64>
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.
Sourcefn phandle(&self, index: usize) -> Result<Phandle>
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
]
Sourcefn str(&self) -> Result<&'dt str>
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