pub struct Block<const N: usize> { /* private fields */ }Expand description
A Block as understood by the Boot ROM.
This could be an Image Definition, or a Partition Table, or maybe some other kind of block.
It contains within the special start and end markers the Boot ROM is looking for.
Implementations§
Source§impl<const N: usize> Block<N>
impl<const N: usize> Block<N>
Sourcepub const fn new(items: [u32; N]) -> Block<N>
pub const fn new(items: [u32; N]) -> Block<N>
Construct a new Binary Block, with the given items.
The length, and the Start and End markers are added automatically. The Block Loop pointer initially points to itself.
Sourcepub const fn with_offset(self, offset: *const u32) -> Block<N>
pub const fn with_offset(self, offset: *const u32) -> Block<N>
Change the Block Loop offset value.
This method isn’t that useful because you can’t evaluate the difference between two pointers in a const context as the addresses aren’t assigned until long after the const evaluator has run.
If you think you need this method, you might want to set a unique random value here and swap it for the real offset as a post-processing step.
Source§impl Block<1>
impl Block<1>
Sourcepub const fn arch_exe(
security: Security,
architecture: Architecture,
) -> Block<1>
pub const fn arch_exe( security: Security, architecture: Architecture, ) -> Block<1>
Construct a new IMAGE_DEF Block, for an EXE with the given security and architecture.
Sourcepub const fn exe(security: Security) -> Block<1>
pub const fn exe(security: Security) -> Block<1>
Construct a new IMAGE_DEF Block, for an EXE with the given security.
The target architecture is taken from the current build target (i.e. Arm or RISC-V).
Sourcepub const fn non_secure_exe() -> Block<1>
pub const fn non_secure_exe() -> Block<1>
Construct a new IMAGE_DEF Block, for a Non-Secure EXE.
The target architecture is taken from the current build target (i.e. Arm or RISC-V).
Sourcepub const fn secure_exe() -> Block<1>
pub const fn secure_exe() -> Block<1>
Construct a new IMAGE_DEF Block, for a Secure EXE.
The target architecture is taken from the current build target (i.e. Arm or RISC-V).
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> Freeze for Block<N>
impl<const N: usize> RefUnwindSafe for Block<N>
impl<const N: usize> !Send for Block<N>
impl<const N: usize> Unpin for Block<N>
impl<const N: usize> UnwindSafe for Block<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more