Struct multiboot2::CommandLineTag
source · #[repr(C)]pub struct CommandLineTag { /* private fields */ }
Expand description
This tag contains the command line string.
The string is a normal C-style UTF-8 zero-terminated string that can be
obtained via the command_line
method.
Implementations§
source§impl CommandLineTag
impl CommandLineTag
sourcepub fn new(command_line: &str) -> BoxedDst<Self>
pub fn new(command_line: &str) -> BoxedDst<Self>
Create a new command line tag from the given string.
sourcepub fn cmdline(&self) -> Result<&str, Utf8Error>
pub fn cmdline(&self) -> Result<&str, Utf8Error>
Reads the command line of the kernel as Rust string slice without the null-byte.
For example, this returns "console=ttyS0"
.if the GRUB config
contains "multiboot2 /mykernel console=ttyS0"
.
If the function returns Err
then perhaps the memory is invalid.
Examples
if let Some(tag) = boot_info.command_line_tag() {
let command_line = tag.cmdline();
assert_eq!(Ok("/bootarg"), command_line);
}
Trait Implementations§
source§impl Debug for CommandLineTag
impl Debug for CommandLineTag
source§impl Hash for CommandLineTag
impl Hash for CommandLineTag
source§impl Ord for CommandLineTag
impl Ord for CommandLineTag
source§fn cmp(&self, other: &CommandLineTag) -> Ordering
fn cmp(&self, other: &CommandLineTag) -> Ordering
source§impl PartialEq for CommandLineTag
impl PartialEq for CommandLineTag
source§fn eq(&self, other: &CommandLineTag) -> bool
fn eq(&self, other: &CommandLineTag) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for CommandLineTag
impl PartialOrd for CommandLineTag
source§impl Pointee for CommandLineTagwhere
[u8]: Pointee,
impl Pointee for CommandLineTagwhere
[u8]: Pointee,
source§impl TagTrait for CommandLineTag
impl TagTrait for CommandLineTag
source§fn dst_size(base_tag: &Tag) -> usize
fn dst_size(base_tag: &Tag) -> usize
Returns the amount of items in the dynamically sized portion of the
DST. Note that this is not the amount of bytes. So if the dynamically
sized portion is 16 bytes in size and each element is 4 bytes big, then
this function must return 4.
source§unsafe fn from_base_tag<'a>(tag: &Tag) -> &'a Self
unsafe fn from_base_tag<'a>(tag: &Tag) -> &'a Self
Creates a reference to a (dynamically sized) tag type in a safe way.
DST tags need to implement a proper
Self::dst_size
implementation. Read more