[][src]Enum dpdk_unix::ListParseError

pub enum ListParseError {
    IoError(Error),
    ContainsAnEmptyIndexOrRange,
    CouldNotParseIndexAsNotAString {
        description: &'static str,
        unparsable_index: Box<[u8]>,
        cause: Utf8Error,
    },
    CouldNotParseIndex {
        description: &'static str,
        unparsable_index: String,
        cause: ParseIntError,
    },
    ContainsMisSortedIndices {
        first: u16,
        next_minimum_index_expected: u16,
    },
    RangeIsNotAnAscendingRangeWithMoreThanOneElement {
        first: u16,
        second: u16,
    },
}

List parse error.

Variants

IoError(Error)

An IO error.

ContainsAnEmptyIndexOrRange

Contains an empty index or range.

CouldNotParseIndexAsNotAString

Could not parse index (not a string).

Fields of CouldNotParseIndexAsNotAString

description: &'static str

Description.

unparsable_index: Box<[u8]>

Unparsable index.

cause: Utf8Error

Cause.

CouldNotParseIndex

Could not parse index.

Fields of CouldNotParseIndex

description: &'static str

Description.

unparsable_index: String

Unparsable index.

cause: ParseIntError

Cause.

ContainsMisSortedIndices

Contains mis-sorted indices.

Fields of ContainsMisSortedIndices

first: u16

First part of index.

next_minimum_index_expected: u16

Minimum expected for next index.

RangeIsNotAnAscendingRangeWithMoreThanOneElement

Range is not an ascending range with more than one element.

Fields of RangeIsNotAnAscendingRangeWithMoreThanOneElement

first: u16

First part of index.

second: u16

Second part of index.

Methods

impl ListParseError[src]

pub fn parse_linux_list_string<Mapper: Fn(u16) -> R, R: Ord>(
    linux_list_string: &[u8],
    mapper: Mapper
) -> Result<BTreeSet<R>, ListParseError>
[src]

Parses a Linux list string used for cpu sets, core masks and NUMA nodes such as "2,4-31,32-63" and "1,2,10-20,100-2000:2/25" (see https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html for an awful description of this mad syntax).

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.

Trait Implementations

impl From<ListParseError> for ProcessStatusStatisticParseError[src]

impl From<Error> for ListParseError[src]

impl Debug for ListParseError[src]

impl Display for ListParseError[src]

impl Error for ListParseError[src]

fn description(&self) -> &str
1.0.0
[src]

This method is soft-deprecated. Read more

fn cause(&self) -> Option<&dyn Error>
1.0.0
[src]

Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

The lower-level cause of this error, if any. Read more

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]