pub struct InStreamCrc32Proof { /* private fields */ }Expand description
Validated attestation that a caller derived a slice’s PAR2 CRC32 in stream.
This is the counterpart to crate::ContiguousAssemblyProof for a single
slice: it does not itself verify anything, it records that the caller
asserted every property that makes a CRC32-only slice verdict admissible,
and refuses to exist when any of them is false.
§What a proven attestation asserts
- The CRC32 covered the slice’s full extent — every byte from the slice’s own offset in the file the recovery set describes, zero-padded to the block size exactly as PAR2 checksums a short final slice.
- Those bytes are the bytes the repair source will serve, already durable, not a speculative or in-flight buffer.
- The same span is independently covered by a second CRC32 cut on an
unrelated grid — for a Usenet download path, the article-aligned yEnc
pcrc32beside the block-aligned PAR2 CRC32.
§What it does not assert
No MD5 was computed, so this is not slice identity: it is the statement that a 32-bit checksum over the slice’s bytes agreed with the recovery set’s IFSC entry. A verdict admitted this way seeds a repair input; it never promotes a file to a whole-file match, and repair still recomputes the IFSC CRC32 and MD5 over every byte it consumes, so an attestation that turns out to be wrong fails the repair loudly rather than producing wrong output. Settle-time verification of slices with no verdict is likewise untouched.
Implementations§
Source§impl InStreamCrc32Proof
impl InStreamCrc32Proof
Sourcepub fn try_new(
covered_length: u64,
slice_fully_covered: bool,
derived_from_durable_bytes: bool,
independently_crc32_covered: bool,
) -> Result<Self, InStreamCrc32ProofError>
pub fn try_new( covered_length: u64, slice_fully_covered: bool, derived_from_durable_bytes: bool, independently_crc32_covered: bool, ) -> Result<Self, InStreamCrc32ProofError>
Validate and record an in-stream CRC32 attestation.
covered_length is the number of the file’s real bytes the derivation
covered for this slice — the full block size, or the short remainder for
a final slice before PAR2’s zero padding. The three flags are the
caller’s assertions described on the type; every one must hold.
Sourcepub fn covered_length(&self) -> u64
pub fn covered_length(&self) -> u64
Real file bytes the attested derivation covered for this slice.
Trait Implementations§
Source§impl Clone for InStreamCrc32Proof
impl Clone for InStreamCrc32Proof
Source§fn clone(&self) -> InStreamCrc32Proof
fn clone(&self) -> InStreamCrc32Proof
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InStreamCrc32Proof
Source§impl Debug for InStreamCrc32Proof
impl Debug for InStreamCrc32Proof
impl Eq for InStreamCrc32Proof
Source§impl PartialEq for InStreamCrc32Proof
impl PartialEq for InStreamCrc32Proof
impl StructuralPartialEq for InStreamCrc32Proof
Auto Trait Implementations§
impl Freeze for InStreamCrc32Proof
impl RefUnwindSafe for InStreamCrc32Proof
impl Send for InStreamCrc32Proof
impl Sync for InStreamCrc32Proof
impl Unpin for InStreamCrc32Proof
impl UnsafeUnpin for InStreamCrc32Proof
impl UnwindSafe for InStreamCrc32Proof
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<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