pub struct Property<'a> { /* private fields */ }Expand description
通用属性,包含名称和原始数据
Implementations§
Source§impl<'a> Property<'a>
impl<'a> Property<'a>
pub fn new(name: &'a str, data: Bytes<'a>) -> Self
pub fn name(&self) -> &'a str
pub fn data(&self) -> Bytes<'a>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn as_u32_iter(&self) -> U32Iter<'a> ⓘ
pub fn as_u32_iter(&self) -> U32Iter<'a> ⓘ
作为 u32 迭代器
Sourcepub fn as_str_iter(&self) -> StrIter<'a> ⓘ
pub fn as_str_iter(&self) -> StrIter<'a> ⓘ
作为字符串迭代器(用于 compatible 等属性)
Sourcepub fn as_address_cells(&self) -> Option<u8>
pub fn as_address_cells(&self) -> Option<u8>
获取为 #address-cells 值
Sourcepub fn as_size_cells(&self) -> Option<u8>
pub fn as_size_cells(&self) -> Option<u8>
获取为 #size-cells 值
Sourcepub fn as_interrupt_cells(&self) -> Option<u8>
pub fn as_interrupt_cells(&self) -> Option<u8>
获取为 #interrupt-cells 值
Sourcepub fn as_phandle(&self) -> Option<Phandle>
pub fn as_phandle(&self) -> Option<Phandle>
获取为 phandle
Sourcepub fn as_device_type(&self) -> Option<&'a str>
pub fn as_device_type(&self) -> Option<&'a str>
获取为 device_type 字符串
Sourcepub fn as_interrupt_parent(&self) -> Option<Phandle>
pub fn as_interrupt_parent(&self) -> Option<Phandle>
获取为 interrupt-parent
Sourcepub fn as_clock_names(&self) -> Option<StrIter<'a>>
pub fn as_clock_names(&self) -> Option<StrIter<'a>>
获取为 clock-names 字符串列表
Sourcepub fn as_compatible(&self) -> Option<StrIter<'a>>
pub fn as_compatible(&self) -> Option<StrIter<'a>>
获取为 compatible 字符串列表
Sourcepub fn is_dma_coherent(&self) -> bool
pub fn is_dma_coherent(&self) -> bool
是否为 dma-coherent 属性
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Property<'a>
impl<'a> RefUnwindSafe for Property<'a>
impl<'a> Send for Property<'a>
impl<'a> Sync for Property<'a>
impl<'a> Unpin for Property<'a>
impl<'a> UnwindSafe for Property<'a>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)