2022-08-29 22:01:54 +08:00
|
|
|
// mod facet_level_value_f64_codec;
|
|
|
|
// mod facet_level_value_u32_codec;
|
|
|
|
// mod facet_string_level_zero_codec;
|
|
|
|
// mod facet_string_level_zero_value_codec;
|
2022-08-31 13:51:11 +08:00
|
|
|
// mod facet_string_zero_bounds_value_codec;
|
2020-12-03 01:31:41 +08:00
|
|
|
mod field_doc_id_facet_f64_codec;
|
|
|
|
mod field_doc_id_facet_string_codec;
|
2022-07-04 14:41:54 +08:00
|
|
|
|
2022-08-29 22:01:54 +08:00
|
|
|
pub mod new;
|
|
|
|
|
2022-07-04 14:41:54 +08:00
|
|
|
use heed::types::OwnedType;
|
2020-11-11 22:48:24 +08:00
|
|
|
|
2022-08-29 22:01:54 +08:00
|
|
|
// pub use self::facet_level_value_f64_codec::FacetLevelValueF64Codec;
|
|
|
|
// pub use self::facet_level_value_u32_codec::FacetLevelValueU32Codec;
|
|
|
|
// pub use self::facet_string_level_zero_codec::FacetStringLevelZeroCodec;
|
|
|
|
// pub use self::facet_string_level_zero_value_codec::{
|
|
|
|
// decode_prefix_string, encode_prefix_string, FacetStringLevelZeroValueCodec,
|
|
|
|
// };
|
2022-08-31 13:51:11 +08:00
|
|
|
// pub use self::facet_string_zero_bounds_value_codec::FacetStringZeroBoundsValueCodec;
|
2020-12-03 01:31:41 +08:00
|
|
|
pub use self::field_doc_id_facet_f64_codec::FieldDocIdFacetF64Codec;
|
|
|
|
pub use self::field_doc_id_facet_string_codec::FieldDocIdFacetStringCodec;
|
2022-07-04 15:28:23 +08:00
|
|
|
use crate::BEU16;
|
2022-07-04 14:41:54 +08:00
|
|
|
|
|
|
|
pub type FieldIdCodec = OwnedType<BEU16>;
|
2021-07-17 18:50:01 +08:00
|
|
|
|
|
|
|
/// Tries to split a slice in half at the given middle point,
|
|
|
|
/// `None` if the slice is too short.
|
|
|
|
pub fn try_split_at(slice: &[u8], mid: usize) -> Option<(&[u8], &[u8])> {
|
|
|
|
if slice.len() >= mid {
|
|
|
|
Some(slice.split_at(mid))
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|