Skip to main content

Bundle

Struct Bundle 

Source
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

Source

pub fn from_file(path: &Path) -> Result<Self>

Read a bundle from a file path.

Source

pub fn from_bytes(bytes: &[u8]) -> Result<Self>

Read a bundle from a byte slice.

Source

pub fn to_bytes(&self) -> Result<Vec<u8>>

Serialize the already parsed sections without changing the signed manifest.

Source

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.

Source

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.

Source

pub fn entry_at(&self, idx: usize) -> Option<&[u8]>

Source

pub fn entry_bytes(&self, record: &IndexRecord) -> Option<&[u8]>

Get the raw response bytes for an index record.

Trait Implementations§

Source§

impl Debug for Bundle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,