Struct sysfs_class::Block [−][src]
pub struct Block { /* fields omitted */ }A block device in /sys/class/block
Methods
impl Block[src]
impl Blockpub fn partition(&self) -> Result<u8>[src]
pub fn partition(&self) -> Result<u8>pub fn removable(&self) -> Result<u8>[src]
pub fn removable(&self) -> Result<u8>pub fn size(&self) -> Result<u64>[src]
pub fn size(&self) -> Result<u64>Trait Implementations
impl Clone for Block[src]
impl Clone for Blockfn clone(&self) -> Block[src]
fn clone(&self) -> BlockReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl SysClass for Block[src]
impl SysClass for Blockfn class() -> &'static str[src]
fn class() -> &'static strReturn the class of the sys object, the name of a folder in /sys/class
unsafe fn from_path_unchecked(path: PathBuf) -> Self[src]
unsafe fn from_path_unchecked(path: PathBuf) -> SelfCreate a sys object from an absolute path without checking path for validity
fn path(&self) -> &Path[src]
fn path(&self) -> &PathReturn the path of the sys object
fn dir() -> PathBuf[src]
fn dir() -> PathBufReturn the path to the sys objects, the full path of a folder in /sys/class
fn from_path(path: &Path) -> Result<Self>[src]
fn from_path(path: &Path) -> Result<Self>Create a sys object from a path, checking it for validity
fn all() -> Result<Vec<Self>>[src]
fn all() -> Result<Vec<Self>>Retrieve all of the object instances of a sys class
fn new(id: &str) -> Result<Self>[src]
fn new(id: &str) -> Result<Self>Create a sys object by id, checking it for validity
fn id(&self) -> &str[src]
fn id(&self) -> &strReturn the id of the sys object
fn read_file<P: AsRef<Path>>(&self, name: P) -> Result<String>[src]
fn read_file<P: AsRef<Path>>(&self, name: P) -> Result<String>Read a file underneath the sys object
fn parse_file<F: FromStr, P: AsRef<Path>>(&self, name: P) -> Result<F> where
F::Err: Display, [src]
fn parse_file<F: FromStr, P: AsRef<Path>>(&self, name: P) -> Result<F> where
F::Err: Display, Parse a number from a file underneath the sys object
fn trim_file<P: AsRef<Path>>(&self, name: P) -> Result<String>[src]
fn trim_file<P: AsRef<Path>>(&self, name: P) -> Result<String>Read a file underneath the sys object and trim whitespace
fn write_file<P: AsRef<Path>, S: AsRef<[u8]>>(
&self,
name: P,
data: S
) -> Result<()>[src]
fn write_file<P: AsRef<Path>, S: AsRef<[u8]>>(
&self,
name: P,
data: S
) -> Result<()>Write a file underneath the sys object