[−][src]Struct fdt_rs::DevTreeProp
A handle to a DevTreeNode
's Device Tree Property
Implementations
impl<'a> DevTreeProp<'a>
[src]
pub fn name(&self) -> Result<&'a Str, DevTreeError>
[src]
Returns the name of the property within the device tree.
#[must_use]pub fn parent(&self) -> DevTreeNode
[src]
Returns the node which this property is attached to
#[must_use]pub fn length(&self) -> usize
[src]
Returns the length of the property value within the device tree
pub unsafe fn get_u32(&self, offset: usize) -> Result<u32, DevTreeError>
[src]
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.
Safety
Device Tree Properties are not strongly typed therefore any dereference could return unexpected data.
This method will access memory using core::ptr::read_unaligned
, therefore an unaligned
offset may be provided.
This method will not panic.
pub unsafe fn get_u64(&self, offset: usize) -> Result<u64, DevTreeError>
[src]
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.
Safety
See the safety note of DevTreeProp::get_u32
pub unsafe fn get_phandle(&self, offset: usize) -> Result<Phandle, DevTreeError>
[src]
A Phandle is simply defined as a u32 value, as such this method performs the same action as
[self.get_u32
]
Safety
See the safety note of DevTreeProp::get_u32
pub unsafe fn get_str(&'a self, offset: usize) -> Result<&'a Str, DevTreeError>
[src]
Returns the string at the given offset if it can be parsed
Safety
See the safety note of DevTreeProp::get_u32
pub unsafe fn get_str_count(&self) -> Result<usize, DevTreeError>
[src]
Safety
See the safety note of DevTreeProp::get_u32
pub unsafe fn get_strlist(
&'a self,
list: &mut [Option<&'a Str>]
) -> Result<usize, DevTreeError>
[src]
&'a self,
list: &mut [Option<&'a Str>]
) -> Result<usize, DevTreeError>
Safety
See the safety note of DevTreeProp::get_u32
pub unsafe fn get_raw(&self) -> &'a [u8]
[src]
Safety
See the safety note of DevTreeProp::get_u32
Trait Implementations
impl<'a> Clone for DevTreeProp<'a>
[src]
fn clone(&self) -> DevTreeProp<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<'a> Send for DevTreeProp<'a>
impl<'a> Sync for DevTreeProp<'a>
impl<'a> Unpin for DevTreeProp<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,