pub struct SidecarPtr {
pub addr: MessageAddr,
pub span: Option<(usize, usize)>,
pub content_hash: String,
}Expand description
A pointer from a reduced placeholder back to its original content in the sidecar.
invert (A6) resolves addr against the sidecar-reconstructed Session
and verifies content_hash before ever substituting content back in — a
stale or foreign sidecar can never silently produce the wrong content.
Fields§
§addr: MessageAddrWhere the original message lives in the canonical full view.
span: Option<(usize, usize)>Removed byte range within the original content; None means the
whole content was removed (as opposed to a sub-span of it).
content_hash: Stringblake3 hex digest of the full original content.
Implementations§
Source§impl SidecarPtr
impl SidecarPtr
Sourcepub fn verify(&self, candidate: &[u8]) -> Result<()>
pub fn verify(&self, candidate: &[u8]) -> Result<()>
Verify that candidate — the content this pointer is presumed to
resolve to — still hashes to Self::content_hash.
This is the hash-verify primitive invert (A6) calls before
substituting any original back into the full view. Returns Err on
any mismatch (tampered/stale/foreign content) rather than ever
substituting wrong content silently.
Sourcepub fn verify_hash(&self, actual: &str) -> Result<()>
pub fn verify_hash(&self, actual: &str) -> Result<()>
Like Self::verify, but takes an already-computed hash directly —
for callers (e.g. hash_turns_range, A10) whose hash formula isn’t
simply “hash these raw bytes” (it’s a hash over several messages’
concatenated wire bytes) but must still fail exactly the same way on
mismatch.
Trait Implementations§
Source§impl Clone for SidecarPtr
impl Clone for SidecarPtr
Source§fn clone(&self) -> SidecarPtr
fn clone(&self) -> SidecarPtr
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more