use std::io;
use crate::codecs::lucene103::postings_format::IntBlockTermState;
pub trait Terms {
fn iterator(&self) -> io::Result<Box<dyn TermsEnum + '_>>;
fn size(&self) -> i64;
fn get_sum_total_term_freq(&self) -> i64;
fn get_sum_doc_freq(&self) -> i64;
fn get_doc_count(&self) -> i32;
fn has_freqs(&self) -> bool;
fn has_offsets(&self) -> bool;
fn has_positions(&self) -> bool;
fn has_payloads(&self) -> bool;
fn get_min(&self) -> Option<&[u8]>;
fn get_max(&self) -> Option<&[u8]>;
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SeekStatus {
End,
Found,
NotFound,
}
pub trait TermsEnum {
fn seek_exact(&mut self, target: &[u8]) -> io::Result<bool>;
fn seek_exact_with_state(&mut self, term: &[u8], state: IntBlockTermState);
fn term(&self) -> &[u8];
fn doc_freq(&mut self) -> io::Result<i32>;
fn total_term_freq(&mut self) -> io::Result<i64>;
fn term_state(&mut self) -> io::Result<IntBlockTermState>;
fn seek_ceil(&mut self, _target: &[u8]) -> io::Result<SeekStatus> {
todo!("seek_ceil not yet implemented")
}
fn next(&mut self) -> io::Result<Option<&[u8]>> {
todo!("next not yet implemented")
}
}