Trait PropertyInt

Source
pub trait PropertyInt: Copy + Sealed {
    // Required methods
    fn read_array_from_fwnode_property<'a>(
        fwnode: &FwNode,
        name: &CStr,
        out: &'a mut [MaybeUninit<Self>],
    ) -> Result<&'a mut [Self]>;
    fn read_array_len_from_fwnode_property(
        fwnode: &FwNode,
        name: &CStr,
    ) -> Result<usize>;
}
Expand description

Implemented for all integers that can be read as properties.

This helper trait is needed on top of the existing Property trait to associate the integer types of various sizes with their corresponding fwnode_property_read_*_array functions.

It must be public, because it appears in the signatures of other public functions, but its methods shouldn’t be used outside the kernel crate.

Required Methods§

Source

fn read_array_from_fwnode_property<'a>( fwnode: &FwNode, name: &CStr, out: &'a mut [MaybeUninit<Self>], ) -> Result<&'a mut [Self]>

Reads a property array.

Source

fn read_array_len_from_fwnode_property( fwnode: &FwNode, name: &CStr, ) -> Result<usize>

Reads the length of a property array.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PropertyInt for i8

Source§

fn read_array_from_fwnode_property<'a>( fwnode: &FwNode, name: &CStr, out: &'a mut [MaybeUninit<Self>], ) -> Result<&'a mut [Self]>

Source§

fn read_array_len_from_fwnode_property( fwnode: &FwNode, name: &CStr, ) -> Result<usize>

Source§

impl PropertyInt for i16

Source§

fn read_array_from_fwnode_property<'a>( fwnode: &FwNode, name: &CStr, out: &'a mut [MaybeUninit<Self>], ) -> Result<&'a mut [Self]>

Source§

fn read_array_len_from_fwnode_property( fwnode: &FwNode, name: &CStr, ) -> Result<usize>

Source§

impl PropertyInt for i32

Source§

fn read_array_from_fwnode_property<'a>( fwnode: &FwNode, name: &CStr, out: &'a mut [MaybeUninit<Self>], ) -> Result<&'a mut [Self]>

Source§

fn read_array_len_from_fwnode_property( fwnode: &FwNode, name: &CStr, ) -> Result<usize>

Source§

impl PropertyInt for i64

Source§

fn read_array_from_fwnode_property<'a>( fwnode: &FwNode, name: &CStr, out: &'a mut [MaybeUninit<Self>], ) -> Result<&'a mut [Self]>

Source§

fn read_array_len_from_fwnode_property( fwnode: &FwNode, name: &CStr, ) -> Result<usize>

Source§

impl PropertyInt for u8

Source§

fn read_array_from_fwnode_property<'a>( fwnode: &FwNode, name: &CStr, out: &'a mut [MaybeUninit<Self>], ) -> Result<&'a mut [Self]>

Source§

fn read_array_len_from_fwnode_property( fwnode: &FwNode, name: &CStr, ) -> Result<usize>

Source§

impl PropertyInt for u16

Source§

fn read_array_from_fwnode_property<'a>( fwnode: &FwNode, name: &CStr, out: &'a mut [MaybeUninit<Self>], ) -> Result<&'a mut [Self]>

Source§

fn read_array_len_from_fwnode_property( fwnode: &FwNode, name: &CStr, ) -> Result<usize>

Source§

impl PropertyInt for u32

Source§

fn read_array_from_fwnode_property<'a>( fwnode: &FwNode, name: &CStr, out: &'a mut [MaybeUninit<Self>], ) -> Result<&'a mut [Self]>

Source§

fn read_array_len_from_fwnode_property( fwnode: &FwNode, name: &CStr, ) -> Result<usize>

Source§

impl PropertyInt for u64

Source§

fn read_array_from_fwnode_property<'a>( fwnode: &FwNode, name: &CStr, out: &'a mut [MaybeUninit<Self>], ) -> Result<&'a mut [Self]>

Source§

fn read_array_len_from_fwnode_property( fwnode: &FwNode, name: &CStr, ) -> Result<usize>

Implementors§