Struct procfs::sys::kernel::BuildInfo

source ·
pub struct BuildInfo {
    pub version: String,
    pub flags: HashSet<String>,
    pub extra: String,
}
Expand description

Represents a kernel build information

Fields§

§version: String§flags: HashSet<String>§extra: String

This field contains any extra data from the /proc/sys/kernel/version file. It generally contains the build date of the kernel, but the format of the date can vary.

A method named extra_date is provided which would try to parse some date formats. When the date format is not supported, an error will be returned. It depends on chrono feature.

Implementations§

Read the kernel build information from current running kernel

Generated by scripts/mkcompile_h when building the kernel. The file is located at /proc/sys/kernel/version.

Check if SMP is ON

Check if PREEMPT is ON

Check if PREEMPTRT is ON

Return version number

This would parse number from first digits of version string. For example, #21~1 to 21.

Parse extra field to DateTime object

This function may fail as TIMESTAMP can be various formats.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Parse a kernel build information string

The associated error which can be returned from parsing.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.