pub enum Partition {
PartitionTable(PartitionTableImage),
Bootloader(BootImage),
Calibration,
Fw1(OTAImage),
Fw2(OTAImage),
Reserved,
Var(RawImage),
System(SystemData),
User(RawImage),
Mp(RawImage),
}
Expand description
Represents different types of partitions in a flash image.
Variants§
PartitionTable(PartitionTableImage)
Bootloader(BootImage)
Calibration
Fw1(OTAImage)
Fw2(OTAImage)
Reserved
Var(RawImage)
System(SystemData)
User(RawImage)
Mp(RawImage)
Implementations§
Source§impl Partition
impl Partition
Sourcepub fn from_record<R>(record: &Record, reader: &mut R) -> Result<Self, Error>
pub fn from_record<R>(record: &Record, reader: &mut R) -> Result<Self, Error>
Creates a Partition
from a Record
and a reader stream.
This function reads the appropriate partition data based on the partition type from the provided record and reader. The partition type is matched and the corresponding partition image is created from the reader.
§Parameters:
record
: The partition record containing metadata (e.g., partition type and length).reader
: The input stream to read the partition data from.
§Returns:
- A
Partition
variant matching the partition type from therecord
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Partition
impl RefUnwindSafe for Partition
impl Send for Partition
impl Sync for Partition
impl Unpin for Partition
impl UnwindSafe for Partition
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