#[non_exhaustive]pub struct BundleManifest {
pub entries: Vec<ManifestEntry>,
/* private fields */
}Expand description
A bundle manifest: the files a bundle publishes (adr/appendix-bundles.md).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.entries: Vec<ManifestEntry>Its files, in manifest order.
Implementations§
Source§impl BundleManifest
impl BundleManifest
Sourcepub const fn new(hash: [u8; 32], entries: Vec<ManifestEntry>) -> Self
pub const fn new(hash: [u8; 32], entries: Vec<ManifestEntry>) -> Self
A manifest of entries whose blob has the BLAKE3 hash hash. A pull
records hash as the source of each file it writes, so a wrong one
makes a later pull of the same entry see its own files as foreign.
Sourcepub const fn hash(&self) -> [u8; 32]
pub const fn hash(&self) -> [u8; 32]
The manifest blob’s BLAKE3 hash. A pull records it as the source of
each file it writes. Filtering entries keeps it: it names the whole
manifest.
Sourcepub fn parse(bytes: &[u8]) -> Result<Self>
pub fn parse(bytes: &[u8]) -> Result<Self>
Parse manifest JSON and check its version.
§Errors
NotAManifest when the bytes are not a manifest, or name a version
other than 1.
Sourcepub fn cached(out_dir: &Path, hash: [u8; 32]) -> Result<Option<Self>>
pub fn cached(out_dir: &Path, hash: [u8; 32]) -> Result<Option<Self>>
The manifest blob hash a pull into out_dir cached, or None when
none is cached. The cache is self-verifying: bytes that do not hash to
hash are an error, as is an unreadable cache file.
§Errors
The cached file cannot be read, does not hash to hash, or is not a
manifest.
Trait Implementations§
Source§impl Clone for BundleManifest
impl Clone for BundleManifest
Auto Trait Implementations§
impl Freeze for BundleManifest
impl RefUnwindSafe for BundleManifest
impl Send for BundleManifest
impl Sync for BundleManifest
impl Unpin for BundleManifest
impl UnsafeUnpin for BundleManifest
impl UnwindSafe for BundleManifest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more