pub struct ImageHandle {
pub primary_header: PrimaryHeader,
pub protected_header: Option<ProtectedHeader>,
pub config: Option<Vec<u8>>,
pub digest_table: Option<DigestTable>,
pub directory: Option<Directory>,
pub path: PathBuf,
pub file_size: u64,
pub id: String,
}Expand description
Represents a goldboot image on disk.
§Binary format
| Section | Encryption Key |
|---|---|
| Primary Header | None |
| Protected Header | Password + SHA256 |
| Image Config | Password + SHA256 |
| Cluster Table | Cluster Key |
| Digest Table | Password + SHA256 |
| Directory | Password + SHA256 |
The target data is divided into equal size sections called “blocks”. Blocks that are nonzero will have an associated “cluster” allocated in the image file. Clusters are variable in size and ideally smaller than their associated blocks (due to compression). If a block does not have an associated cluster, that block is zero.
Fields§
§primary_header: PrimaryHeaderThe primary file header
protected_header: Option<ProtectedHeader>The secondary header
config: Option<Vec<u8>>The encoded config used to build the image
digest_table: Option<DigestTable>The digest table
directory: Option<Directory>The section directory
path: PathBufThe filesystem path to the image file
file_size: u64The size in bytes of the image file on disk
id: StringThe image’s ID (SHA256 hash)
Implementations§
Source§impl ImageHandle
impl ImageHandle
Sourcepub fn load(&mut self, password: Option<String>) -> Result<()>
pub fn load(&mut self, password: Option<String>) -> Result<()>
Load all sections into memory except the cluster table. If the image is encrypted, the sections will be decrypted.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageHandle
impl RefUnwindSafe for ImageHandle
impl Send for ImageHandle
impl Sync for ImageHandle
impl Unpin for ImageHandle
impl UnwindSafe for ImageHandle
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