SysAttributeExt

Trait SysAttributeExt 

Source
pub trait SysAttributeExt: SysAttribute {
    // Provided methods
    fn read_str<E: SysEntity + ?Sized>(&self, entity: &E) -> IoResult<String> { ... }
    fn write_str<E: SysEntity + ?Sized>(
        &self,
        entity: &E,
        s: &str,
    ) -> IoResult<()> { ... }
    fn parse<T: FromStr<Err = E>, E, ENT: SysEntity + ?Sized>(
        &self,
        entity: &ENT,
    ) -> Result<T, EitherErr2<Error, E>> { ... }
    fn path<E: SysEntity + ?Sized>(&self, entity: &E) -> PathBuf { ... }
    fn exists<E: SysEntity + ?Sized>(&self, entity: &E) -> bool { ... }
    fn read_value<E: SysEntity + ?Sized>(&self, entity: &E) -> IoResult<Vec<u8>> { ... }
    fn write_value<E: SysEntity + ?Sized>(
        &self,
        entity: &E,
        value: &[u8],
    ) -> IoResult<()> { ... }
    fn readonly<E: SysEntity + ?Sized>(&self, entity: &E) -> bool { ... }
}
Expand description

sysfs entity attribute functionality extension

Provided Methods§

Source

fn read_str<E: SysEntity + ?Sized>(&self, entity: &E) -> IoResult<String>

read attribute as string

Source

fn write_str<E: SysEntity + ?Sized>(&self, entity: &E, s: &str) -> IoResult<()>

write attribute string value to sysfsfilter_map

Source

fn parse<T: FromStr<Err = E>, E, ENT: SysEntity + ?Sized>( &self, entity: &ENT, ) -> Result<T, EitherErr2<Error, E>>

read and parse the attribute value

Source

fn path<E: SysEntity + ?Sized>(&self, entity: &E) -> PathBuf

full path to attribute file

Source

fn exists<E: SysEntity + ?Sized>(&self, entity: &E) -> bool

returns true if the path to the attribute file exists

Source

fn read_value<E: SysEntity + ?Sized>(&self, entity: &E) -> IoResult<Vec<u8>>

read attribute value from sysfs

Source

fn write_value<E: SysEntity + ?Sized>( &self, entity: &E, value: &[u8], ) -> IoResult<()>

write attribute value to sysfs

Source

fn readonly<E: SysEntity + ?Sized>(&self, entity: &E) -> bool

Returns true if the attribute is readonly

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.

Implementors§