Skip to main content

InStreamCrc32Proof

Struct InStreamCrc32Proof 

Source
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 pcrc32 beside 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

Source

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.

Source

pub fn covered_length(&self) -> u64

Real file bytes the attested derivation covered for this slice.

Trait Implementations§

Source§

impl Clone for InStreamCrc32Proof

Source§

fn clone(&self) -> InStreamCrc32Proof

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for InStreamCrc32Proof

Source§

impl Debug for InStreamCrc32Proof

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for InStreamCrc32Proof

Source§

impl PartialEq for InStreamCrc32Proof

Source§

fn eq(&self, other: &InStreamCrc32Proof) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for InStreamCrc32Proof

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more