Trait sysfuss::SysAttribute

source ·
pub trait SysAttribute {
    // Required method
    fn filename(&self) -> PathBuf;

    // Provided methods
    fn path(&self, entity: &dyn SysEntity) -> PathBuf { ... }
    fn exists(&self, entity: &dyn SysEntity) -> bool { ... }
    fn read_value(&self, entity: &dyn SysEntity) -> IoResult<Vec<u8>> { ... }
    fn write_value(&self, entity: &dyn SysEntity, value: &[u8]) -> IoResult<()> { ... }
    fn readonly(&self, entity: &dyn SysEntity) -> bool { ... }
}
Expand description

sysfs entity attribute file functionality

Required Methods§

source

fn filename(&self) -> PathBuf

attribute file name

Provided Methods§

source

fn path(&self, entity: &dyn SysEntity) -> PathBuf

full path to attribute file

source

fn exists(&self, entity: &dyn SysEntity) -> bool

returns true if the path to the attribute file exists

source

fn read_value(&self, entity: &dyn SysEntity) -> IoResult<Vec<u8>>

read attribute value from sysfs

source

fn write_value(&self, entity: &dyn SysEntity, value: &[u8]) -> IoResult<()>

write attribute value to sysfs

source

fn readonly(&self, entity: &dyn SysEntity) -> bool

Returns true if the attribute is readonly

Implementations on Foreign Types§

source§

impl SysAttribute for String

source§

impl SysAttribute for &str

Implementors§