Struct multiboot2::Tag
source · #[repr(C)]pub struct Tag {
pub typ: TagTypeId,
pub size: u32,
}
Expand description
Common base structure for all tags that can be passed via the Multiboot2 Information Structure (MBI) to a Multiboot2 payload/program/kernel.
Can be transformed to any other tag (sized or unsized/DST) via
Tag::cast_tag
.
Do not confuse them with the Multiboot2 header tags. They are something different.
Fields§
§typ: TagTypeId
§size: u32
Implementations§
source§impl Tag
impl Tag
sourcepub fn cast_tag<'a, T: TagTrait + ?Sized + 'a>(&'a self) -> &'a T
pub fn cast_tag<'a, T: TagTrait + ?Sized + 'a>(&'a self) -> &'a T
Casts the base tag to the specific tag type.
sourcepub fn parse_slice_as_string(bytes: &[u8]) -> Result<&str, StringError>
pub fn parse_slice_as_string(bytes: &[u8]) -> Result<&str, StringError>
Parses the provided byte sequence as Multiboot string, which maps to a
[str
].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tag
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnwindSafe for Tag
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more