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§
Sourcefn read_str<E: SysEntity + ?Sized>(&self, entity: &E) -> IoResult<String>
fn read_str<E: SysEntity + ?Sized>(&self, entity: &E) -> IoResult<String>
read attribute as string
Sourcefn write_str<E: SysEntity + ?Sized>(&self, entity: &E, s: &str) -> IoResult<()>
fn write_str<E: SysEntity + ?Sized>(&self, entity: &E, s: &str) -> IoResult<()>
write attribute string value to sysfsfilter_map
Sourcefn parse<T: FromStr<Err = E>, E, ENT: SysEntity + ?Sized>(
&self,
entity: &ENT,
) -> Result<T, EitherErr2<Error, E>>
fn parse<T: FromStr<Err = E>, E, ENT: SysEntity + ?Sized>( &self, entity: &ENT, ) -> Result<T, EitherErr2<Error, E>>
read and parse the attribute value
Sourcefn exists<E: SysEntity + ?Sized>(&self, entity: &E) -> bool
fn exists<E: SysEntity + ?Sized>(&self, entity: &E) -> bool
returns true if the path to the attribute file exists
Sourcefn read_value<E: SysEntity + ?Sized>(&self, entity: &E) -> IoResult<Vec<u8>>
fn read_value<E: SysEntity + ?Sized>(&self, entity: &E) -> IoResult<Vec<u8>>
read attribute value from sysfs
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.