pub struct DataIntegrity { /* private fields */ }Expand description
Data integrity system for corruption detection and verification
Implementations§
Source§impl DataIntegrity
impl DataIntegrity
Sourcepub fn with_config(config: IntegrityConfig) -> Self
pub fn with_config(config: IntegrityConfig) -> Self
Create a new data integrity system with custom configuration
Sourcepub async fn initialize(&mut self) -> Result<(), IntegrityError>
pub async fn initialize(&mut self) -> Result<(), IntegrityError>
Initialize the data integrity system
Sourcepub async fn shutdown(&mut self) -> Result<(), IntegrityError>
pub async fn shutdown(&mut self) -> Result<(), IntegrityError>
Shutdown the data integrity system
Sourcepub async fn verify_integrity(
&mut self,
data: &[u8],
key: &str,
) -> Result<IntegrityResult, IntegrityError>
pub async fn verify_integrity( &mut self, data: &[u8], key: &str, ) -> Result<IntegrityResult, IntegrityError>
Verify data integrity
Sourcepub async fn compute_checksum(
&mut self,
data: &[u8],
key: &str,
) -> Result<String, IntegrityError>
pub async fn compute_checksum( &mut self, data: &[u8], key: &str, ) -> Result<String, IntegrityError>
Compute and store checksum for data
Sourcepub async fn increment_version(
&mut self,
key: &str,
) -> Result<u64, IntegrityError>
pub async fn increment_version( &mut self, key: &str, ) -> Result<u64, IntegrityError>
Increment version for data
Sourcepub async fn get_stats(&self) -> IntegrityStats
pub async fn get_stats(&self) -> IntegrityStats
Get integrity statistics
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if the system is initialized
Sourcepub fn checksum_verifier(&self) -> &ChecksumVerifier
pub fn checksum_verifier(&self) -> &ChecksumVerifier
Get checksum verifier
Sourcepub fn version_verifier(&self) -> &VersionVerifier
pub fn version_verifier(&self) -> &VersionVerifier
Get version verifier
Sourcepub fn corruption_detector(&self) -> &CorruptionDetector
pub fn corruption_detector(&self) -> &CorruptionDetector
Get corruption detector
Trait Implementations§
Source§impl Clone for DataIntegrity
impl Clone for DataIntegrity
Source§fn clone(&self) -> DataIntegrity
fn clone(&self) -> DataIntegrity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DataIntegrity
impl Debug for DataIntegrity
Auto Trait Implementations§
impl Freeze for DataIntegrity
impl !RefUnwindSafe for DataIntegrity
impl Send for DataIntegrity
impl Sync for DataIntegrity
impl Unpin for DataIntegrity
impl !UnwindSafe for DataIntegrity
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
Mutably borrows from an owned value. Read more