MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / validate

Method validate

nodedb-wal/src/record/header.rs:128–143  ·  view source on GitHub ↗
(&self, offset: u64)

Source from the content-addressed store, hash-verified

126 }
127
128 pub fn validate(&self, offset: u64) -> Result<()> {
129 if self.magic != WAL_MAGIC {
130 return Err(WalError::InvalidMagic {
131 offset,
132 expected: WAL_MAGIC,
133 actual: self.magic,
134 });
135 }
136 if self.format_version != WAL_FORMAT_VERSION {
137 return Err(WalError::UnsupportedVersion {
138 version: self.format_version,
139 supported: WAL_FORMAT_VERSION,
140 });
141 }
142 Ok(())
143 }
144}
145
146#[cfg(test)]

Callers 3

next_recordMethod · 0.45
next_headerMethod · 0.45
next_recordMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected