Enum ImagePartition
pub(crate) enum ImagePartition {
Mtd {
device: Device,
buffer: Box<[u8]>,
},
Ubi(Device),
}Expand description
Partition that holds an image of a FOTA blob.
Variants§
Implementations§
§impl ImagePartition
impl ImagePartition
pub(crate) fn open(
image_type: &ImageType,
partition: &Partition,
) -> Result<Self>
pub(crate) fn open( image_type: &ImageType, partition: &Partition, ) -> Result<Self>
Opens partition for reading and writing.
pub(crate) fn open_read_only(
image_type: &ImageType,
partition: &Partition,
) -> Result<Self>
pub(crate) fn open_read_only( image_type: &ImageType, partition: &Partition, ) -> Result<Self>
Opens partition for reading only.
A UBI partition is still attached if it isn’t yet. UBI can write to the flash during the attach.
fn open_with( image_type: &ImageType, partition: &Partition, write: bool, ) -> Result<Self>
pub(crate) fn reader(&mut self) -> Result<ImageReader<'_>>
pub(crate) fn reader(&mut self) -> Result<ImageReader<'_>>
Returns a reader over the image.
The reader of a raw partition skips the ECC check. Callers check the data with the MD5 sum of the FOTA config.
pub(crate) const fn should_cache(&self) -> bool
pub(crate) const fn should_cache(&self) -> bool
Returns whether reading the image is slow enough to cache it in a file before patching.
Auto Trait Implementations§
impl Freeze for ImagePartition
impl RefUnwindSafe for ImagePartition
impl Send for ImagePartition
impl Sync for ImagePartition
impl Unpin for ImagePartition
impl UnsafeUnpin for ImagePartition
impl UnwindSafe for ImagePartition
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