pub struct Property<'a> { /* private fields */ }Expand description
A generic device tree property containing name and raw data.
Represents a property with a name and associated data. Provides methods for accessing and interpreting the data in various formats (u32, u64, strings, etc.).
Implementations§
Source§impl<'a> Property<'a>
impl<'a> Property<'a>
Sourcepub fn new(name: &'a str, data: Bytes<'a>) -> Self
pub fn new(name: &'a str, data: Bytes<'a>) -> Self
Creates a new property from a name and data bytes.
Sourcepub fn as_u32_iter(&self) -> U32Iter<'a> ⓘ
pub fn as_u32_iter(&self) -> U32Iter<'a> ⓘ
Returns an iterator over u32 values in the property data.
Sourcepub fn as_str_iter(&self) -> StrIter<'a> ⓘ
pub fn as_str_iter(&self) -> StrIter<'a> ⓘ
Returns an iterator over null-terminated strings in the property data.
Used for properties like compatible that contain multiple strings.
Sourcepub fn as_u64(&self) -> Option<u64>
pub fn as_u64(&self) -> Option<u64>
Returns the data as a single u64 value.
Returns None if the data is not exactly 8 bytes.
Sourcepub fn as_u32(&self) -> Option<u32>
pub fn as_u32(&self) -> Option<u32>
Returns the data as a single u32 value.
Returns None if the data is not exactly 4 bytes.
Sourcepub fn as_address_cells(&self) -> Option<u8>
pub fn as_address_cells(&self) -> Option<u8>
Returns the property value as #address-cells.
Only returns a value if the property name is “#address-cells”.
Sourcepub fn as_size_cells(&self) -> Option<u8>
pub fn as_size_cells(&self) -> Option<u8>
Returns the property value as #size-cells.
Only returns a value if the property name is “#size-cells”.
Sourcepub fn as_interrupt_cells(&self) -> Option<u8>
pub fn as_interrupt_cells(&self) -> Option<u8>
Returns the property value as #interrupt-cells.
Only returns a value if the property name is “#interrupt-cells”.
Sourcepub fn as_status(&self) -> Option<Status>
pub fn as_status(&self) -> Option<Status>
Returns the property value as a Status enum.
Only returns a value if the property name is “status”.
Sourcepub fn as_phandle(&self) -> Option<Phandle>
pub fn as_phandle(&self) -> Option<Phandle>
Returns the property value as a phandle.
Only returns a value if the property name is “phandle”.
Sourcepub fn as_device_type(&self) -> Option<&'a str>
pub fn as_device_type(&self) -> Option<&'a str>
Returns the property value as device_type string.
Only returns a value if the property name is “device_type”.
Sourcepub fn as_interrupt_parent(&self) -> Option<Phandle>
pub fn as_interrupt_parent(&self) -> Option<Phandle>
Returns the property value as interrupt-parent phandle.
Only returns a value if the property name is “interrupt-parent”.
Sourcepub fn as_clock_names(&self) -> Option<StrIter<'a>>
pub fn as_clock_names(&self) -> Option<StrIter<'a>>
Returns the property value as clock-names string list.
Only returns a value if the property name is “clock-names”.
Sourcepub fn as_compatible(&self) -> Option<StrIter<'a>>
pub fn as_compatible(&self) -> Option<StrIter<'a>>
Returns the property value as compatible string list.
Only returns a value if the property name is “compatible”.
Sourcepub fn is_dma_coherent(&self) -> bool
pub fn is_dma_coherent(&self) -> bool
Returns true if this is a dma-coherent property.
A dma-coherent property has no data and indicates DMA coherence.