Struct multiboot2::builder::InformationBuilder

source ·
pub struct InformationBuilder(/* private fields */);
Expand description

Builder to construct a valid Multiboot2 information dynamically at runtime. The tags will appear in the order of their corresponding enumeration, except for the END tag.

Implementations§

source§

impl InformationBuilder

source

pub const fn new() -> Self

Creates a new builder.

source

pub fn expected_len(&self) -> usize

Returns the expected length of the boot information, when the Self::build-method is called. This function assumes that the begin of the boot information is 8-byte aligned and automatically adds padding between tags to ensure that each tag is 8-byte aligned.

source

pub fn build(self) -> BootInformationBytes

Constructs the bytes for a valid Multiboot2 information with the given properties.

source

pub fn add_tag<T: TagTrait + ?Sized>( self, tag: &T ) -> Result<Self, RedundantTagError>

Adds a arbitrary tag that implements TagTrait to the builder. Only TagType::Module and TagType::Custom are allowed to occur multiple times. For other tags, this function returns an error.

It is not required to manually add the TagType::End tag.

The tags of the boot information will be ordered naturally, i.e., by their numeric ID.

source

pub fn basic_memory_info_tag(self, tag: BasicMemoryInfoTag) -> Self

Adds a ‘basic memory information’ tag (represented by BasicMemoryInfoTag) to the builder.

source

pub fn bootloader_name_tag(self, tag: BoxedDst<BootLoaderNameTag>) -> Self

Adds a ‘bootloader name’ tag (represented by BootLoaderNameTag) to the builder.

source

pub fn command_line_tag(self, tag: BoxedDst<CommandLineTag>) -> Self

Adds a ‘command line’ tag (represented by CommandLineTag) to the builder.

source

pub fn efisdt32_tag(self, tag: EFISdt32Tag) -> Self

Adds a ‘EFI 32-bit system table pointer’ tag (represented by EFISdt32Tag) to the builder.

source

pub fn efisdt64_tag(self, tag: EFISdt64Tag) -> Self

Adds a ‘EFI 64-bit system table pointer’ tag (represented by EFISdt64Tag) to the builder.

source

pub fn efi_boot_services_not_exited_tag(self) -> Self

Adds a ‘EFI boot services not terminated’ tag (represented by EFIBootServicesNotExitedTag) to the builder.

source

pub fn efi_image_handle32(self, tag: EFIImageHandle32Tag) -> Self

Adds a ‘EFI 32-bit image handle pointer’ tag (represented by EFIImageHandle32Tag) to the builder.

source

pub fn efi_image_handle64(self, tag: EFIImageHandle64Tag) -> Self

Adds a ‘EFI 64-bit image handle pointer’ tag (represented by EFIImageHandle64Tag) to the builder.

source

pub fn efi_memory_map_tag(self, tag: BoxedDst<EFIMemoryMapTag>) -> Self

Adds a ‘EFI Memory map’ tag (represented by EFIMemoryMapTag) to the builder.

source

pub fn elf_sections_tag(self, tag: BoxedDst<ElfSectionsTag>) -> Self

Adds a ‘ELF-Symbols’ tag (represented by ElfSectionsTag) to the builder.

source

pub fn framebuffer_tag(self, tag: BoxedDst<FramebufferTag>) -> Self

Adds a ‘Framebuffer info’ tag (represented by FramebufferTag) to the builder.

source

pub fn image_load_addr(self, tag: ImageLoadPhysAddrTag) -> Self

Adds a ‘Image load base physical address’ tag (represented by ImageLoadPhysAddrTag) to the builder.

source

pub fn memory_map_tag(self, tag: BoxedDst<MemoryMapTag>) -> Self

Adds a (none EFI) ‘memory map’ tag (represented by MemoryMapTag) to the builder.

source

pub fn add_module_tag(self, tag: BoxedDst<ModuleTag>) -> Self

Adds a ‘Modules’ tag (represented by ModuleTag) to the builder. This tag can occur multiple times in boot information.

source

pub fn rsdp_v1_tag(self, tag: RsdpV1Tag) -> Self

Adds a ‘ACPI old RSDP’ tag (represented by RsdpV1Tag) to the builder.

source

pub fn rsdp_v2_tag(self, tag: RsdpV2Tag) -> Self

Adds a ‘ACPI new RSDP’ tag (represented by RsdpV2Tag) to the builder.

source

pub fn smbios_tag(self, tag: BoxedDst<SmbiosTag>) -> Self

Adds a ‘SMBIOS tables’ tag (represented by SmbiosTag) to the builder.

Trait Implementations§

source§

impl Debug for InformationBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for InformationBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl PartialEq for InformationBuilder

source§

fn eq(&self, other: &InformationBuilder) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for InformationBuilder

source§

impl StructuralPartialEq for InformationBuilder

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.