Struct procfs::sys::kernel::Version [−][src]
Expand description
Represents a kernel version, in major.minor.release version.
Fields
major: u8
minor: u8
patch: u16
Implementations
Returns the kernel version of the currently 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
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 = "3.16.0-6-amd64".parse().unwrap();
let b = KernelVersion::new(3, 16, 0);
assert_eq!(a, b);
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
Auto Trait Implementations
impl RefUnwindSafe for Version
impl UnwindSafe for Version
Blanket Implementations
Mutably borrows from an owned value. Read more