pub struct ChainCompressionTracker { /* private fields */ }Expand description
Tracks context across hops in a single chain, computes minimal deltas.
Implementations§
Source§impl ChainCompressionTracker
impl ChainCompressionTracker
pub fn new(chain_id: String) -> Self
Sourcepub fn register_hop(
&mut self,
hop: u16,
content_refs: Vec<String>,
freshness_refs: Vec<String>,
) -> Result<(), ChainCompressionError>
pub fn register_hop( &mut self, hop: u16, content_refs: Vec<String>, freshness_refs: Vec<String>, ) -> Result<(), ChainCompressionError>
Register context refs at a given hop.
Sourcepub fn compute_delta(
&self,
from_hop: u16,
to_hop: u16,
) -> Result<ChainDelta, ChainCompressionError>
pub fn compute_delta( &self, from_hop: u16, to_hop: u16, ) -> Result<ChainDelta, ChainCompressionError>
Compute the delta between two hops.
Sourcepub fn forward_delta(
&self,
parent_hop: u16,
child_refs: &[String],
) -> Result<ChainDelta, ChainCompressionError>
pub fn forward_delta( &self, parent_hop: u16, child_refs: &[String], ) -> Result<ChainDelta, ChainCompressionError>
Compute what a new hop needs vs the parent hop (forward delta).
Sourcepub fn stale_items(&self, stale_threshold_hop: u16) -> Vec<&ChainContextItem>
pub fn stale_items(&self, stale_threshold_hop: u16) -> Vec<&ChainContextItem>
Items that haven’t been referenced since stale_threshold_hop.
pub fn current_hop(&self) -> u16
pub fn total_tracked_items(&self) -> usize
Auto Trait Implementations§
impl Freeze for ChainCompressionTracker
impl RefUnwindSafe for ChainCompressionTracker
impl Send for ChainCompressionTracker
impl Sync for ChainCompressionTracker
impl Unpin for ChainCompressionTracker
impl UnsafeUnpin for ChainCompressionTracker
impl UnwindSafe for ChainCompressionTracker
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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