Struct multiboot2::BootLoaderNameTag
source · #[repr(C)]pub struct BootLoaderNameTag { /* private fields */ }
Expand description
The bootloader name tag.
Implementations§
source§impl BootLoaderNameTag
impl BootLoaderNameTag
pub fn new(name: &str) -> BoxedDst<Self>
sourcepub fn name(&self) -> Result<&str, Utf8Error>
pub fn name(&self) -> Result<&str, Utf8Error>
Reads the name of the bootloader that is booting the kernel as Rust string slice without the null-byte.
For example, this returns "GRUB 2.02~beta3-5"
.
If the function returns Err
then perhaps the memory is invalid.
Examples
if let Some(tag) = boot_info.boot_loader_name_tag() {
assert_eq!(Ok("GRUB 2.02~beta3-5"), tag.name());
}
Trait Implementations§
source§impl Debug for BootLoaderNameTag
impl Debug for BootLoaderNameTag
source§impl Hash for BootLoaderNameTag
impl Hash for BootLoaderNameTag
source§impl Ord for BootLoaderNameTag
impl Ord for BootLoaderNameTag
source§fn cmp(&self, other: &BootLoaderNameTag) -> Ordering
fn cmp(&self, other: &BootLoaderNameTag) -> Ordering
source§impl PartialEq for BootLoaderNameTag
impl PartialEq for BootLoaderNameTag
source§fn eq(&self, other: &BootLoaderNameTag) -> bool
fn eq(&self, other: &BootLoaderNameTag) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for BootLoaderNameTag
impl PartialOrd for BootLoaderNameTag
source§impl Pointee for BootLoaderNameTagwhere
[u8]: Pointee,
impl Pointee for BootLoaderNameTagwhere
[u8]: Pointee,
source§impl TagTrait for BootLoaderNameTag
impl TagTrait for BootLoaderNameTag
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