pub struct RegionTaint { /* private fields */ }Expand description
Taint tracking state for a single region.
Tracks the current maximum taint level across all content in the region, along with per-entry source tracking to support taint recovery on eviction.
Implementations§
Source§impl RegionTaint
impl RegionTaint
Sourcepub fn level(&self) -> TaintLevel
pub fn level(&self) -> TaintLevel
Get the current taint level of this region.
Sourcepub fn add_entry(&mut self, taint: TaintLevel)
pub fn add_entry(&mut self, taint: TaintLevel)
Record that a new entry was added with the given taint level. Updates the region’s current taint level if necessary.
Sourcepub fn remove_oldest(&mut self)
pub fn remove_oldest(&mut self)
Record that the oldest entry was removed (e.g., sliding window eviction). Recomputes taint from remaining entries.
Sourcepub fn remove_at(&mut self, idx: usize)
pub fn remove_at(&mut self, idx: usize)
Record that the entry at idx was removed.
Recomputes taint from remaining entries.
Sourcepub fn recompute(&mut self)
pub fn recompute(&mut self)
Recompute the taint level from remaining entries. Called after eviction to allow taint recovery.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Get the number of tracked entries.
Sourcepub fn from_entry_taints(entry_taints: Vec<TaintLevel>) -> Self
pub fn from_entry_taints(entry_taints: Vec<TaintLevel>) -> Self
Get the taint level of a specific entry by index. Rebuild from a persisted list of per-entry taints.
current_level is derived rather than stored, so a restored region ends
up at exactly the level its entries justify - and recovers as they evict,
the same as one that was never persisted.
pub fn entry_taint(&self, index: usize) -> Option<TaintLevel>
Trait Implementations§
Source§impl Clone for RegionTaint
impl Clone for RegionTaint
Source§fn clone(&self) -> RegionTaint
fn clone(&self) -> RegionTaint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more