pub struct Bundle {
pub header: FileHeader,
pub manifest: Manifest,
pub manifest_bytes: Vec<u8>,
pub seal_bytes: Vec<u8>,
pub index: Vec<IndexRecord>,
pub data: Vec<u8>,
}Expand description
A parsed ahu bundle, loaded into memory.
Fields§
§header: FileHeader§manifest: Manifest§manifest_bytes: Vec<u8>§seal_bytes: Vec<u8>§index: Vec<IndexRecord>§data: Vec<u8>Implementations§
Source§impl Bundle
impl Bundle
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Read a bundle from a byte slice.
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>>
pub fn to_bytes(&self) -> Result<Vec<u8>>
Serialize the already parsed sections without changing the signed manifest.
Sourcepub fn lookup(&self, entry_key: &[u8; 32]) -> Option<&[u8]>
pub fn lookup(&self, entry_key: &[u8; 32]) -> Option<&[u8]>
Look up an entry by its entry key (SHA-256 of DER CertID). Returns the default (discriminator=0) entry.
Sourcepub fn lookup_preferred(
&self,
entry_key: &[u8; 32],
preferences: &[u16],
) -> Option<&[u8]>
pub fn lookup_preferred( &self, entry_key: &[u8; 32], preferences: &[u16], ) -> Option<&[u8]>
Look up the best-matching entry given a list of preferred discriminators.
pub fn entry_at(&self, idx: usize) -> Option<&[u8]>
Sourcepub fn entry_bytes(&self, record: &IndexRecord) -> Option<&[u8]>
pub fn entry_bytes(&self, record: &IndexRecord) -> Option<&[u8]>
Get the raw response bytes for an index record.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bundle
impl RefUnwindSafe for Bundle
impl Send for Bundle
impl Sync for Bundle
impl Unpin for Bundle
impl UnsafeUnpin for Bundle
impl UnwindSafe for Bundle
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