pub struct ReceiverBaselines { /* private fields */ }Expand description
Receiver-only installed bytes. Applying into scratch never installs or ACKs the result; the caller must decode, validate and accept it first.
Implementations§
Source§impl ReceiverBaselines
impl ReceiverBaselines
Sourcepub fn new(limits: BaselineLimits) -> Result<ReceiverBaselines, BaselineError>
pub fn new(limits: BaselineLimits) -> Result<ReceiverBaselines, BaselineError>
Fallibly preallocate count and byte budgets; see the module recipe.
Sourcepub fn install(
&mut self,
tick: u32,
bytes: &[u8],
) -> Result<RetainOutcome, BaselineError>
pub fn install( &mut self, tick: u32, bytes: &[u8], ) -> Result<RetainOutcome, BaselineError>
Retain bytes after application validation/acceptance, before issuing the snapshot ACK. On failure, do not ACK or publish the snapshot. This method does not parse bytes or check external session/membership/tick fields.
Sourcepub fn apply_into(
&self,
delta: &Delta,
destination: &mut [u8],
) -> Result<usize, ApplyError>
pub fn apply_into( &self, delta: &Delta, destination: &mut [u8], ) -> Result<usize, ApplyError>
Apply against the exact installed base tick into caller scratch. Reject nonadvancing result ticks, missing baselines and invalid deltas before writes. Success preserves the output tail and installed history. Missing or invalid baselines need caller-controlled full recovery; preserve request rate limits. Nonadvancing packets can simply be ignored. The codec cannot detect same-length baseline content from another session: external session authentication and immutable exact-byte installation are required.
Sourcepub fn get(&self, tick: u32) -> Option<&[u8]>
pub fn get(&self, tick: u32) -> Option<&[u8]>
Exact installed bytes available for reconstruction.
Sourcepub fn retained_bytes(&self) -> usize
pub fn retained_bytes(&self) -> usize
Sum of retained installed byte lengths.
Sourcepub fn latest_tick(&self) -> Option<u32>
pub fn latest_tick(&self) -> Option<u32>
Latest installed tick, distinct from a merely applied scratch result.