Skip to main content

linux_kernel_cmdline/
lib.rs

1//! Kernel command line parsing utilities.
2//!
3//! This module provides functionality for parsing and working with kernel command line
4//! arguments, supporting both key-only switches and key-value pairs with proper quote handling.
5//!
6//! The kernel command line is not required to be UTF-8.  The `bytes`
7//! module works on arbitrary byte data and attempts to parse the
8//! command line in the same manner as the kernel itself.
9//!
10//! The `utf8` module performs the same functionality, but requires
11//! all data to be valid UTF-8.
12
13pub mod bytes;
14pub mod utf8;
15
16#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
17/// Possible outcomes for `add_or_modify` operations.
18pub enum Action {
19    /// The parameter did not exist before and was added
20    Added,
21    /// The parameter existed before, but contained a different value.
22    /// The value was updated to the newly-requested value.
23    Modified,
24    /// The parameter existed before, and contained the same value as
25    /// the newly-requested value.  No modification was made.
26    Existed,
27}