[][src]Struct fdt_rs::DevTreeProp

pub struct DevTreeProp<'a> { /* fields omitted */ }

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]

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.