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
impl InformationBuilder
sourcepub fn expected_len(&self) -> usize
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.
sourcepub fn build(self) -> BootInformationBytes
pub fn build(self) -> BootInformationBytes
Constructs the bytes for a valid Multiboot2 information with the given properties.
sourcepub fn add_tag<T: TagTrait + ?Sized>(
self,
tag: &T,
) -> Result<Self, RedundantTagError>
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.
sourcepub fn basic_memory_info_tag(self, tag: BasicMemoryInfoTag) -> Self
pub fn basic_memory_info_tag(self, tag: BasicMemoryInfoTag) -> Self
Adds a ‘basic memory information’ tag (represented by BasicMemoryInfoTag
) to the builder.
sourcepub fn bootloader_name_tag(self, tag: BoxedDst<BootLoaderNameTag>) -> Self
pub fn bootloader_name_tag(self, tag: BoxedDst<BootLoaderNameTag>) -> Self
Adds a ‘bootloader name’ tag (represented by BootLoaderNameTag
) to the builder.
sourcepub fn command_line_tag(self, tag: BoxedDst<CommandLineTag>) -> Self
pub fn command_line_tag(self, tag: BoxedDst<CommandLineTag>) -> Self
Adds a ‘command line’ tag (represented by CommandLineTag
) to the builder.
sourcepub fn efisdt32_tag(self, tag: EFISdt32Tag) -> Self
pub fn efisdt32_tag(self, tag: EFISdt32Tag) -> Self
Adds a ‘EFI 32-bit system table pointer’ tag (represented by EFISdt32Tag
) to the builder.
sourcepub fn efisdt64_tag(self, tag: EFISdt64Tag) -> Self
pub fn efisdt64_tag(self, tag: EFISdt64Tag) -> Self
Adds a ‘EFI 64-bit system table pointer’ tag (represented by EFISdt64Tag
) to the builder.
sourcepub fn efi_boot_services_not_exited_tag(self) -> Self
pub fn efi_boot_services_not_exited_tag(self) -> Self
Adds a ‘EFI boot services not terminated’ tag (represented by EFIBootServicesNotExitedTag
) to the builder.
sourcepub fn efi_image_handle32(self, tag: EFIImageHandle32Tag) -> Self
pub fn efi_image_handle32(self, tag: EFIImageHandle32Tag) -> Self
Adds a ‘EFI 32-bit image handle pointer’ tag (represented by EFIImageHandle32Tag
) to the builder.
sourcepub fn efi_image_handle64(self, tag: EFIImageHandle64Tag) -> Self
pub fn efi_image_handle64(self, tag: EFIImageHandle64Tag) -> Self
Adds a ‘EFI 64-bit image handle pointer’ tag (represented by EFIImageHandle64Tag
) to the builder.
sourcepub fn efi_memory_map_tag(self, tag: BoxedDst<EFIMemoryMapTag>) -> Self
pub fn efi_memory_map_tag(self, tag: BoxedDst<EFIMemoryMapTag>) -> Self
Adds a ‘EFI Memory map’ tag (represented by EFIMemoryMapTag
) to the builder.
sourcepub fn elf_sections_tag(self, tag: BoxedDst<ElfSectionsTag>) -> Self
pub fn elf_sections_tag(self, tag: BoxedDst<ElfSectionsTag>) -> Self
Adds a ‘ELF-Symbols’ tag (represented by ElfSectionsTag
) to the builder.
sourcepub fn framebuffer_tag(self, tag: BoxedDst<FramebufferTag>) -> Self
pub fn framebuffer_tag(self, tag: BoxedDst<FramebufferTag>) -> Self
Adds a ‘Framebuffer info’ tag (represented by FramebufferTag
) to the builder.
sourcepub fn image_load_addr(self, tag: ImageLoadPhysAddrTag) -> Self
pub fn image_load_addr(self, tag: ImageLoadPhysAddrTag) -> Self
Adds a ‘Image load base physical address’ tag (represented by ImageLoadPhysAddrTag
) to the builder.
sourcepub fn memory_map_tag(self, tag: BoxedDst<MemoryMapTag>) -> Self
pub fn memory_map_tag(self, tag: BoxedDst<MemoryMapTag>) -> Self
Adds a (none EFI) ‘memory map’ tag (represented by MemoryMapTag
) to the builder.
sourcepub fn add_module_tag(self, tag: BoxedDst<ModuleTag>) -> Self
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.
sourcepub fn rsdp_v1_tag(self, tag: RsdpV1Tag) -> Self
pub fn rsdp_v1_tag(self, tag: RsdpV1Tag) -> Self
Adds a ‘ACPI old RSDP’ tag (represented by RsdpV1Tag
) to the builder.
sourcepub fn rsdp_v2_tag(self, tag: RsdpV2Tag) -> Self
pub fn rsdp_v2_tag(self, tag: RsdpV2Tag) -> Self
Adds a ‘ACPI new RSDP’ tag (represented by RsdpV2Tag
) to the builder.
sourcepub fn smbios_tag(self, tag: BoxedDst<SmbiosTag>) -> Self
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
impl Debug for InformationBuilder
source§impl Default for InformationBuilder
impl Default for InformationBuilder
source§impl PartialEq for InformationBuilder
impl PartialEq for InformationBuilder
source§fn eq(&self, other: &InformationBuilder) -> bool
fn eq(&self, other: &InformationBuilder) -> bool
self
and other
values to be equal, and is used
by ==
.