pub struct Bundle { /* private fields */ }Implementations§
Source§impl Bundle
impl Bundle
Sourcepub fn from_parts(
manifest: Manifest,
content: BTreeMap<BundleRelativePath, Vec<u8>>,
) -> Result<Self, BundleError>
pub fn from_parts( manifest: Manifest, content: BTreeMap<BundleRelativePath, Vec<u8>>, ) -> Result<Self, BundleError>
Restores a Bundle from an existing manifest and content map.
§Errors
Returns an error when the manifest and content do not match.
Sourcepub fn from_files(
manifest: Manifest,
files: BTreeMap<BundleRelativePath, (FileKind, Vec<u8>)>,
) -> Result<Self, BundleError>
pub fn from_files( manifest: Manifest, files: BTreeMap<BundleRelativePath, (FileKind, Vec<u8>)>, ) -> Result<Self, BundleError>
Builds a verified Bundle and computes every content hash.
§Errors
Returns an error for unsupported schemas or an inconsistent file set.
Sourcepub fn from_files_with_modes(
manifest: Manifest,
files: BTreeMap<BundleRelativePath, (FileKind, u32, Vec<u8>)>,
) -> Result<Self, BundleError>
pub fn from_files_with_modes( manifest: Manifest, files: BTreeMap<BundleRelativePath, (FileKind, u32, Vec<u8>)>, ) -> Result<Self, BundleError>
Builds a verified Bundle with portable file modes.
§Errors
Returns an error when the schema or file set is invalid.
pub fn manifest(&self) -> &Manifest
pub fn files(&self) -> &BTreeMap<BundleRelativePath, Vec<u8>>
pub fn content_hash(&self) -> String
Sourcepub fn verify(&self) -> Result<(), BundleError>
pub fn verify(&self) -> Result<(), BundleError>
Verifies the schema, declared files, and SHA-256 hashes.
§Errors
Returns an error when schema or file integrity checks fail.
Sourcepub fn to_yaml_bytes(&self) -> Result<Vec<u8>, BundleError>
pub fn to_yaml_bytes(&self) -> Result<Vec<u8>, BundleError>
Serializes this verified Bundle to deterministic YAML bytes.
§Errors
Returns an error when verification or serialization fails.
Sourcepub fn from_yaml_bytes(input: &[u8]) -> Result<Self, BundleError>
pub fn from_yaml_bytes(input: &[u8]) -> Result<Self, BundleError>
Parses and verifies a Bundle from YAML bytes.
§Errors
Returns an error for malformed YAML, unsupported schemas, invalid hex, or hash mismatch.
Source§impl Bundle
impl Bundle
Sourcepub fn write_directory(&self, output: &Path) -> Result<(), BundleError>
pub fn write_directory(&self, output: &Path) -> Result<(), BundleError>
Writes a verified Bundle as an inspectable directory.
§Errors
Returns an error for an existing output, invalid Bundle, or filesystem failure.
Sourcepub fn from_directory(input: &Path) -> Result<Self, BundleError>
pub fn from_directory(input: &Path) -> Result<Self, BundleError>
Loads and verifies an inspectable Bundle directory.
§Errors
Returns an error for unsafe paths, undeclared files, invalid metadata, or hash mismatch.
Trait Implementations§
impl Eq for Bundle
impl StructuralPartialEq for Bundle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.