mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-09 13:45:43 +00:00
47 lines
951 B
Rust
47 lines
951 B
Rust
mod merge;
|
|
mod ops;
|
|
mod ops_indexed_value;
|
|
mod positive_blob;
|
|
mod negative_blob;
|
|
|
|
pub use self::merge::Merge;
|
|
pub use self::positive_blob::{PositiveBlob, PositiveBlobBuilder};
|
|
pub use self::negative_blob::{NegativeBlob, NegativeBlobBuilder};
|
|
|
|
use std::error::Error;
|
|
use fst::Map;
|
|
use crate::data::DocIndexes;
|
|
|
|
pub enum Blob {
|
|
Positive(PositiveBlob),
|
|
Negative(NegativeBlob),
|
|
}
|
|
|
|
impl Blob {
|
|
pub fn sign(&self) -> Sign {
|
|
match self {
|
|
Blob::Positive(_) => Sign::Positive,
|
|
Blob::Negative(_) => Sign::Negative,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
|
pub enum Sign {
|
|
Positive,
|
|
Negative,
|
|
}
|
|
|
|
impl Sign {
|
|
pub fn alternate(self) -> Sign {
|
|
match self {
|
|
Sign::Positive => Sign::Negative,
|
|
Sign::Negative => Sign::Positive,
|
|
}
|
|
}
|
|
}
|
|
|
|
pub fn ordered_blobs_from_slice(slice: &[u8]) -> Result<Vec<Blob>, Box<Error>> {
|
|
unimplemented!()
|
|
}
|