Struct procfs::KernelVersion[][src]

pub struct KernelVersion {
    pub major: u8,
    pub minor: u8,
    pub patch: u8,
}

Represents a kernel version, in major.minor.release version.

Fields

Methods

impl KernelVersion
[src]

Returns the kernel version of the curretly running kernel.

This is taken from /proc/sys/kernel/osrelease;

Parses a kernel version string, in major.minor.release syntax.

Note that any extra information (stuff after a dash) is ignored.

Example

let a = KernelVersion::from_str("3.16.0-6-amd64").unwrap();
let b = KernelVersion::new(3, 16, 0);
assert_eq!(a, b);

Trait Implementations

impl Debug for KernelVersion
[src]

Formats the value using the given formatter. Read more

impl Copy for KernelVersion
[src]

impl Clone for KernelVersion
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Eq for KernelVersion
[src]

impl PartialEq for KernelVersion
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Ord for KernelVersion
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialOrd for KernelVersion
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations