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<(), ReductionError>
pub fn verify(&self, candidate: &[u8]) -> Result<(), ReductionError>
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<(), ReductionError>
pub fn verify_hash(&self, actual: &str) -> Result<(), ReductionError>
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 moreSource§impl Debug for SidecarPtr
impl Debug for SidecarPtr
Source§impl<'de> Deserialize<'de> for SidecarPtr
impl<'de> Deserialize<'de> for SidecarPtr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SidecarPtr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SidecarPtr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for SidecarPtr
Source§impl PartialEq for SidecarPtr
impl PartialEq for SidecarPtr
Source§impl Serialize for SidecarPtr
impl Serialize for SidecarPtr
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for SidecarPtr
Auto Trait Implementations§
impl Freeze for SidecarPtr
impl RefUnwindSafe for SidecarPtr
impl Send for SidecarPtr
impl Sync for SidecarPtr
impl Unpin for SidecarPtr
impl UnsafeUnpin for SidecarPtr
impl UnwindSafe for SidecarPtr
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.