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],
) -> PartitionTableBlock
pub const fn add_partition_item( self, unpartitioned: UnpartitionedSpace, partitions: &[Partition], ) -> PartitionTableBlock
Add a partition to the partition table
Sourcepub const fn with_version(self, major: u16, minor: u16) -> PartitionTableBlock
pub const fn with_version(self, major: u16, minor: u16) -> PartitionTableBlock
Add a version number to the partition table
Sourcepub const fn with_sha256(self) -> PartitionTableBlock
pub const fn with_sha256(self) -> PartitionTableBlock
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for PartitionTableBlock
impl Default for PartitionTableBlock
Source§fn default() -> PartitionTableBlock
fn default() -> PartitionTableBlock
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PartitionTableBlock
impl RefUnwindSafe for PartitionTableBlock
impl Send for PartitionTableBlock
impl Sync for PartitionTableBlock
impl Unpin 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