pub struct MaterializedSet {
pub order_excluded: u64,
/* private fields */
}Expand description
One shard’s materialized result set: ordered (order_value, key)
members with the bounded top-K discipline (keep K + Δ where
Δ = K/4; underflow requests a local rebuild from the base
indexes — RFC §2).
Fields§
§order_excluded: u64Members excluded because they’re absent from the order index.
Implementations§
Source§impl MaterializedSet
impl MaterializedSet
Sourcepub fn new(top_k: u32, desc: bool) -> Self
pub fn new(top_k: u32, desc: bool) -> Self
New set with the declared bound (0 = unbounded) and order direction (the bound evicts from the view’s WORST end).
Sourcepub fn apply(
&mut self,
key: &[u8],
member: bool,
order: Option<IndexValue>,
) -> bool
pub fn apply( &mut self, key: &[u8], member: bool, order: Option<IndexValue>, ) -> bool
Apply one key’s membership verdict + order value. Returns
true if the set UNDERFLOWED below K after a removal (the
caller must schedule a local rebuild).
Sourcepub fn page(
&self,
after: Option<&(IndexValue, Vec<u8>)>,
limit: usize,
desc: bool,
) -> Vec<(IndexValue, Vec<u8>)>
pub fn page( &self, after: Option<&(IndexValue, Vec<u8>)>, limit: usize, desc: bool, ) -> Vec<(IndexValue, Vec<u8>)>
Ordered page. desc = false: ascending from just past after;
desc = true: DESCENDING from just below after (a DESC view
must take each shard’s LARGEST members — taking the ascending
head and reversing at the merge yields the wrong member set).
Sourcepub fn approx_bytes(&self) -> u64
pub fn approx_bytes(&self) -> u64
Approximate heap bytes (RFC §5 formula’s measured side).