pub struct CheckpointValidator;Expand description
Validates checkpoint data against stored CRC-32 and size metadata.
Implementations§
Source§impl CheckpointValidator
impl CheckpointValidator
Sourcepub fn compute_crc32(data: &[u8]) -> u32
pub fn compute_crc32(data: &[u8]) -> u32
Compute the CRC-32 of data.
Sourcepub fn validate(data: &[u8], expected_crc32: u32) -> Result<(), ValidationError>
pub fn validate(data: &[u8], expected_crc32: u32) -> Result<(), ValidationError>
Return Ok(()) if the CRC-32 of data matches expected_crc32.
Sourcepub fn validate_record(
record: &CheckpointRecord,
data: &[u8],
) -> Result<(), ValidationError>
pub fn validate_record( record: &CheckpointRecord, data: &[u8], ) -> Result<(), ValidationError>
Validate both the CRC-32 and the recorded size of a checkpoint.
Returns the first error encountered (size is checked after CRC).
Auto Trait Implementations§
impl Freeze for CheckpointValidator
impl RefUnwindSafe for CheckpointValidator
impl Send for CheckpointValidator
impl Sync for CheckpointValidator
impl Unpin for CheckpointValidator
impl UnsafeUnpin for CheckpointValidator
impl UnwindSafe for CheckpointValidator
Blanket Implementations§
impl<T> Allocation for T
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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 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>
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