pub struct PackRangeClaim {
pub pack_id: String,
pub etag: String,
pub start: u64,
pub end: u64,
/* private fields */
}Expand description
One coalesced physical range read, plus the partition of authorized records it covers.
Fields§
§pack_id: String§etag: StringProvider entity tag pinning the pack revision this claim was resolved against. A repack changes the ETag, invalidating the claim without touching any manifest.
start: u64§end: u64Implementations§
Source§impl PackRangeClaim
impl PackRangeClaim
Sourcepub fn new(
pack_id: impl Into<String>,
etag: impl Into<String>,
start: u64,
end: u64,
records: Vec<PackRecord>,
) -> PackRangeClaim
pub fn new( pack_id: impl Into<String>, etag: impl Into<String>, start: u64, end: u64, records: Vec<PackRecord>, ) -> PackRangeClaim
Build a claim over records, sorting them into offset-canonical order.
Sorting here is deliberate and is the whole point of weft #1070: the canonical order is physical, so a pack whose object order differs from its offset order still produces a contiguous, checkable partition.
Sourcepub fn records(&self) -> &[PackRecord]
pub fn records(&self) -> &[PackRecord]
Records in offset-canonical order.
Sourcepub fn byte_len(&self) -> Option<u64>
pub fn byte_len(&self) -> Option<u64>
Total bytes this claim authorizes, or None if the range is inverted.
Sourcepub fn address(&self) -> ContentHash
pub fn address(&self) -> ContentHash
The claim’s content address — BLAKE3 of its canonical bytes.
Sourcepub fn decode(bytes: &[u8]) -> Result<PackRangeClaim, PackClaimDecodeError>
pub fn decode(bytes: &[u8]) -> Result<PackRangeClaim, PackClaimDecodeError>
Decode strictly, rejecting truncation, trailing bytes, non-UTF-8 ids, out-of-order records, and any non-canonical spelling.
Trait Implementations§
Source§impl Clone for PackRangeClaim
impl Clone for PackRangeClaim
Source§fn clone(&self) -> PackRangeClaim
fn clone(&self) -> PackRangeClaim
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more