feat(bls): basic support for boot loader interface

This commit is contained in:
2025-10-28 23:23:12 -04:00
parent f82d24a206
commit e7d2438e5f
4 changed files with 78 additions and 19 deletions

View File

@@ -28,6 +28,7 @@ pub struct BootableEntry {
context: Rc<SproutContext>,
declaration: EntryDeclaration,
default: bool,
pin_name: bool,
}
impl BootableEntry {
@@ -44,6 +45,7 @@ impl BootableEntry {
context,
declaration,
default: false,
pin_name: false,
}
}
@@ -72,6 +74,11 @@ impl BootableEntry {
self.default
}
/// Fetch whether the entry is pinned, which prevents prefixing.
pub fn is_pin_name(&self) -> bool {
self.pin_name
}
/// Swap out the context of the entry.
pub fn swap_context(&mut self, context: Rc<SproutContext>) {
self.context = context;
@@ -87,6 +94,11 @@ impl BootableEntry {
self.default = true;
}
/// Mark this entry as being pinned, which prevents prefixing.
pub fn mark_pin_name(&mut self) {
self.pin_name = true;
}
/// Prepend the name of the entry with `prefix`.
pub fn prepend_name_prefix(&mut self, prefix: &str) {
self.name.insert_str(0, prefix);