Trait Property

Source
pub trait Property: Sized + Sealed {
    // Required method
    fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>;
}
Expand description

Implemented for types that can be read as properties.

This is implemented for strings, integers and arrays of integers. It’s used to make FwNode::property_read generic over the type of property being read. There are also two dedicated methods to read other types, because they require more specialized function signatures:

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_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Used to make FwNode::property_read generic.

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 Property for i8

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl Property for i16

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl Property for i32

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl Property for i64

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl Property for u8

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl Property for u16

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl Property for u32

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl Property for u64

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl<const N: usize> Property for [i8; N]

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl<const N: usize> Property for [i16; N]

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl<const N: usize> Property for [i32; N]

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl<const N: usize> Property for [i64; N]

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl<const N: usize> Property for [u8; N]

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl<const N: usize> Property for [u16; N]

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl<const N: usize> Property for [u32; N]

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Source§

impl<const N: usize> Property for [u64; N]

Source§

fn read_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<Self>

Implementors§