zipora 3.1.7

High-performance Rust implementation providing advanced data structures and compression algorithms with memory safety guarantees. Features LRU page cache, sophisticated caching layer, fiber-based concurrency, real-time compression, secure memory pools, SIMD optimizations, and complete C FFI for migration from C++.
//! Elias-Fano Encoding — quasi-succinct monotone integer sequence.

pub mod basic;
pub(crate) mod chunk;
pub mod hybrid;
pub mod optimal;
pub mod partitioned;

pub use basic::{EliasFano, EliasFanoBatchCursor, EliasFanoCursor, EliasFanoIter};
pub use hybrid::{HybridPostingList, PostingEncoding};
pub use optimal::{
    OptimalPartitionedEliasFano, OptimalPefBatchCursor, OptimalPefCursor, OptimalPefIter,
};
pub use partitioned::{
    PartitionedEliasFano, PartitionedEliasFanoBatchCursor, PartitionedEliasFanoCursor,
    PartitionedEliasFanoIter,
};

/// Common interface for all monotone integer sequence (posting list) encodings.
pub trait PostingList {
    /// Number of elements in the list.
    fn len(&self) -> usize;
    
    /// Whether the list is empty.
    fn is_empty(&self) -> bool {
        self.len() == 0
    }
    
    /// Get the i-th element.
    fn get(&self, index: usize) -> Option<u64>;
    
    /// Find the first element >= target. Returns (index, value).
    fn next_geq(&self, target: u64) -> Option<(usize, u64)>;
    
    /// Estimated memory usage in bytes.
    fn size_bytes(&self) -> usize;
}

#[cfg(test)]
mod tests;