pub struct SnapshotValidator { /* private fields */ }
Expand description
Validates SQLite snapshot databases for integrity and expected content.
Performs comprehensive validation including database connectivity, schema verification, and data integrity checks.
Implementations§
Source§impl SnapshotValidator
impl SnapshotValidator
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new validator with predefined expected tables.
Expected tables include:
log
- Blockchain log entrieslog_status
- Log processing statuslog_topic_info
- Log topic informationseaql_migrations
- Database migration tracking
Note: sqlite_sequence
is not required as it’s automatically managed by SQLite
Sourcepub async fn validate_snapshot(
&self,
db_path: &Path,
) -> SnapshotResult<SnapshotInfo>
pub async fn validate_snapshot( &self, db_path: &Path, ) -> SnapshotResult<SnapshotInfo>
Validates a snapshot database for integrity and expected content.
Performs comprehensive validation:
- File existence and accessibility
- Database connectivity
- Schema validation (expected tables)
- Data integrity checks
- Content statistics gathering
§Arguments
db_path
- Path to the SQLite database file to validate
§Returns
SnapshotInfo
containing validation results and database metadata
§Errors
SnapshotError::Validation
- Database corruption or schema issuesSnapshotError::Io
- File access errors
Sourcepub async fn check_data_consistency(&self, db_path: &Path) -> SnapshotResult<()>
pub async fn check_data_consistency(&self, db_path: &Path) -> SnapshotResult<()>
Checks data consistency
Trait Implementations§
Source§impl Default for SnapshotValidator
impl Default for SnapshotValidator
Source§fn default() -> SnapshotValidator
fn default() -> SnapshotValidator
Returns the “default value” for a type. Read more
Source§impl PartialEq for SnapshotValidator
impl PartialEq for SnapshotValidator
impl Eq for SnapshotValidator
impl StructuralPartialEq for SnapshotValidator
Auto Trait Implementations§
impl Freeze for SnapshotValidator
impl RefUnwindSafe for SnapshotValidator
impl Send for SnapshotValidator
impl Sync for SnapshotValidator
impl Unpin for SnapshotValidator
impl UnwindSafe for SnapshotValidator
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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