#[non_exhaustive]pub struct ManifestEntry {
pub path: String,
pub hash: String,
pub size: Option<u64>,
pub chunks: Option<Vec<ManifestChunk>>,
/* private fields */
}Expand description
One file of a BundleManifest.
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.path: StringThe file’s POSIX relative path under the output directory.
hash: StringThe file’s whole-file BLAKE3 hash (b3:hex), which the fetch verifies.
size: Option<u64>The file’s size. Optional on the wire: the pull uses it as the first size claim and for progress totals, and verifies the true size.
chunks: Option<Vec<ManifestChunk>>The file’s ordered chunk decomposition, a range-dedup hint. Chunks it
shares with a sibling entry are spliced from disk instead of paid for
twice. The whole file is still verified by hash.
Implementations§
Source§impl ManifestEntry
impl ManifestEntry
Sourcepub fn new(
path: impl Into<String>,
hash: impl Into<String>,
size: Option<u64>,
) -> Self
pub fn new( path: impl Into<String>, hash: impl Into<String>, size: Option<u64>, ) -> Self
An entry for the file at path with whole-file hash and size, and
no chunk hints.
Sourcepub fn land_at(self, path: impl Into<String>) -> Self
pub fn land_at(self, path: impl Into<String>) -> Self
This entry, landing at path under the output directory in place of
its manifest path. The pull records the manifest path as the source of
the file it writes. A second land_at keeps the first manifest path.
Setting the path field directly makes the pull record that path as
the manifest path.
Sourcepub fn manifest_path(&self) -> &str
pub fn manifest_path(&self) -> &str
The entry’s path in its manifest: where it lands, unless
Self::land_at moved it.
Sourcepub fn with_chunks(self, chunks: Vec<ManifestChunk>) -> Self
pub fn with_chunks(self, chunks: Vec<ManifestChunk>) -> Self
This entry with the chunk decomposition chunks.
Trait Implementations§
Source§impl Clone for ManifestEntry
impl Clone for ManifestEntry
Source§impl Debug for ManifestEntry
impl Debug for ManifestEntry
Source§impl<'de> Deserialize<'de> for ManifestEntry
impl<'de> Deserialize<'de> for ManifestEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ManifestEntry
impl RefUnwindSafe for ManifestEntry
impl Send for ManifestEntry
impl Sync for ManifestEntry
impl Unpin for ManifestEntry
impl UnsafeUnpin for ManifestEntry
impl UnwindSafe for ManifestEntry
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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