Skip to main content

Module kernel_version

Module kernel_version 

Source
Available on crate feature sys only.
Expand description

Kernel version type for system information.

This module provides a type-safe abstraction for kernel versions, ensuring valid version number parsing and comparison.

Kernel versions typically follow semantic versioning (major.minor.patch) with an optional release/build string.

§Examples

use bare_types::sys::KernelVersion;

// Parse from string
let version: KernelVersion = "6.8.0-40-generic".parse()?;

// Access components
assert_eq!(version.major(), 6);
assert_eq!(version.minor(), 8);
assert_eq!(version.patch(), 0);

// Get release string
assert_eq!(version.release(), Some("40-generic"));

// Compare versions
assert!(version >= KernelVersion::new(6, 0, 0));

Structs§

KernelVersion
Kernel version.

Enums§

KernelVersionError
Error type for kernel version parsing.