Trait amdgpu_sysfs::sysfs::SysFS

source ·
pub trait SysFS {
    // Required method
    fn get_path(&self) -> &Path;

    // Provided methods
    fn read_file(&self, file: impl AsRef<Path> + Debug) -> Result<String, Error> { ... }
    fn read_file_parsed<T: FromStr<Err = E>, E: ToString>(
        &self,
        file: &str
    ) -> Result<T, Error> { ... }
    fn write_file<C: AsRef<[u8]> + Send>(
        &self,
        file: &str,
        contents: C
    ) -> Result<(), Error> { ... }
}
Expand description

General functionality of a SysFS.

Required Methods§

source

fn get_path(&self) -> &Path

Gets the path of the current SysFS.

Provided Methods§

source

fn read_file(&self, file: impl AsRef<Path> + Debug) -> Result<String, Error>

Reads the content of a file in the SysFS.

source

fn read_file_parsed<T: FromStr<Err = E>, E: ToString>( &self, file: &str ) -> Result<T, Error>

Reads the content of a file and then parses it

source

fn write_file<C: AsRef<[u8]> + Send>( &self, file: &str, contents: C ) -> Result<(), Error>

Write to a file in the SysFS.

Object Safety§

This trait is not object safe.

Implementors§