Trait dpdk_unix::PathExt[][src]

pub trait PathExt {
    fn to_c_string(&self) -> CString;
fn make_file_read_write_all(&self) -> Result<()>;
fn make_folder_searchable_to_all(&self) -> Result<()>;
fn read_hexadecimal_value_with_prefix<P: Fn(&str) -> Result<T, ParseIntError>, T>(
        &self,
        size: usize,
        parser: P
    ) -> Result<T>;
fn read_raw_string(&self) -> Result<String>;
fn read_string_without_line_feed(&self) -> Result<String>;
fn read_value<F>(&self) -> Result<F>
    where
        F: FromStr,
        <F as FromStr>::Err: 'static + Send + Sync + Error
;
fn write_value<D: Display>(&self, value: D) -> Result<()>;
fn read_linux_core_or_numa_list<Mapper: Fn(u16) -> R, R: Ord>(
        &self,
        mapper: Mapper
    ) -> Result<BTreeSet<R>, ListParseError>;
fn parse_linux_core_or_numa_mask(&self) -> Result<u32, Error>;
fn parse_virtual_memory_statistics_file(
        &self
    ) -> Result<HashMap<VirtualMemoryStatisticName, u64>>;
fn parse_memory_information_file(
        &self,
        memory_information_name_prefix: &str
    ) -> Result<MemoryInformation, MemoryInformationParseError>; fn read_hexadecimal_value_with_prefix_u16(&self) -> Result<u16> { ... } }

An extension trait to make it easier to work with sys and proc files and folders.

Required Methods

Converts a Path to a CString.

Makes a file read-write to all.

Makes a folder searchable to all (ie gives it read and execute permissions).

Reads a value from a file which is line-feed terminated and is hexadecimal using a parser.

Reads a file as a string.

Reads a file as a string, expecting a final line feed.

The returned string lacks a final line feed.

Reads a value from a file which is line-feed terminated.

Writes a value to a file which is line-feed terminated.

Reads and parses a linux core or numa list string from a file.

Returns a BTreeSet with the zero-based indices found in the string. For example, "2,4-31,32-63" would return a set with all values between 0 to 63 except 0, 1 and 3.

Reads and parses a linux core or numa mask string from a file.

Parses a virtual memory statistics file (vmstat).

Parses a memory information file (meminfo).

Provided Methods

Reads a value from a file which is line-feed terminated and is hexadecimal into an u16.

Implementations on Foreign Types

impl PathExt for Path
[src]

Parses the meminfo file.

Implementors