pub struct PartitionTableBlock { /* private fields */ }Expand description
Describes a partition table.
Don’t store this as a static - make sure you convert it to a block.
Implementations§
Source§impl PartitionTableBlock
impl PartitionTableBlock
Sourcepub const fn new() -> PartitionTableBlock
pub const fn new() -> PartitionTableBlock
Create an empty Block, big enough for a partition table.
At a minimum you need to call Self::add_partition_item.
Sourcepub const fn add_partition_item(
self,
unpartitioned: UnpartitionedSpace,
partitions: &[Partition],
) -> Self
pub const fn add_partition_item( self, unpartitioned: UnpartitionedSpace, partitions: &[Partition], ) -> Self
Add a partition to the partition table
Sourcepub const fn with_version(self, major: u16, minor: u16) -> Self
pub const fn with_version(self, major: u16, minor: u16) -> Self
Add a version number to the partition table
Sourcepub const fn with_sha256(self) -> Self
pub const fn with_sha256(self) -> Self
Add a a SHA256 hash of the Block
Adds a HASH_DEF covering all the previous items in the Block, and a
HASH_VALUE with a SHA-256 hash of them.
Trait Implementations§
Source§impl Clone for PartitionTableBlock
impl Clone for PartitionTableBlock
Source§fn clone(&self) -> PartitionTableBlock
fn clone(&self) -> PartitionTableBlock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PartitionTableBlock
impl RefUnwindSafe for PartitionTableBlock
impl Send for PartitionTableBlock
impl Sync for PartitionTableBlock
impl Unpin for PartitionTableBlock
impl UnsafeUnpin for PartitionTableBlock
impl UnwindSafe for PartitionTableBlock
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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