fn from_str(s: &str) -> Result<IoCounters> {
        let mut parts = s.split_whitespace().skip(2);

        let name: String = parts.try_from_next()?;
        let read_count = parts.try_parse_next()?;
        let read_merged_count = parts.try_parse_next()?;
        let read_bytes = parts
            .try_parse_next()
            .map(|bytes: u64| Information::new::<information::byte>(bytes * DISK_SECTOR_SIZE))?;
        let mut parts = parts.skip(1);
        let write_count = parts.try_parse_next()?;
        let write_merged_count = parts.try_parse_next()?;
        let write_bytes = parts
            .try_parse_next()
            .map(|bytes: u64| Information::new::<information::byte>(bytes * DISK_SECTOR_SIZE))?;
        let mut parts = parts.skip(2);
        let busy_time = parts
            .try_parse_next()
            .map(|seconds: u64| Time::new::<time::second>(seconds as f64))?;

        Ok(IoCounters {
            name,
            read_count,
            read_merged_count,
            read_bytes,
            write_count,
            write_merged_count,
            write_bytes,
            busy_time,
        })
    }
// At the moment supports format used in Linux 2.6+,
// except ignoring discard values introduced in Linux 4.18.
//
// https://www.kernel.org/doc/Documentation/iostats.txt
// https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
At the moment supports format used in Linux 2.6+,
except ignoring discard values introduced in Linux 4.18.


At the moment supports format used in Linux 2 . 6 + except ignoring discard values introduced in Linux 4 . 18 .
fn from_str(s: &str) -> Result<IoCounters> {
        let mut parts = s.split_whitespace().skip(2);
        let name: String = parts.try_from_next()?;
        let read_count = parts.try_parse_next()?;
        let read_merged_count = parts.try_parse_next()?;
        let read_bytes = parts
            .try_parse_next()
            .map(|bytes: u64| Information::new::<information::byte>(bytes * DISK_SECTOR_SIZE))?;
        let mut parts = parts.skip(1);
        let write_count = parts.try_parse_next()?;
        let write_merged_count = parts.try_parse_next()?;
        let write_bytes = parts
            .try_parse_next()
            .map(|bytes: u64| Information::new::<information::byte>(bytes * DISK_SECTOR_SIZE))?;
        let mut parts = parts.skip(2);
        let busy_time = parts
            .try_parse_next()
            .map(|seconds: u64| Time::new::<time::second>(seconds as f64))?;
        Ok(IoCounters {
            name,
            read_count,
            read_merged_count,
            read_bytes,
            write_count,
            write_merged_count,
            write_bytes,
            busy_time,
        })
    }
fn from_str ( s : & str ) -> Result < IoCounters > { let mut parts = s . split_whitespace ( ) . skip ( 2 ) ; let name : String = parts . try_from_next ( ) ? ; let read_count = parts . try_parse_next ( ) ? ; let read_merged_count = parts . try_parse_next ( ) ? ; let read_bytes = parts . try_parse_next ( ) . map ( | bytes : u64 | Information :: new :: < information :: byte > ( bytes * DISK_SECTOR_SIZE ) ) ? ; let mut parts = parts . skip ( 1 ) ; let write_count = parts . try_parse_next ( ) ? ; let write_merged_count = parts . try_parse_next ( ) ? ; let write_bytes = parts . try_parse_next ( ) . map ( | bytes : u64 | Information :: new :: < information :: byte > ( bytes * DISK_SECTOR_SIZE ) ) ? ; let mut parts = parts . skip ( 2 ) ; let busy_time = parts . try_parse_next ( ) . map ( | seconds : u64 | Time :: new :: < time :: second > ( seconds as f64 ) ) ? ; Ok ( IoCounters { name , read_count , read_merged_count , read_bytes , write_count , write_merged_count , write_bytes , busy_time , } ) }
At the moment supports format used in Linux 2.6+,
except ignoring discard values introduced in Linux 4.18.
At the moment supports format used in Linux 2 . 6 + except ignoring discard values introduced in Linux 4 . 18 .
s
&str
s
&str