mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 00:31:02 +00:00
Move the documents back into the LMDB database
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
mod mtbl_codec;
|
||||
mod roaring_bitmap_codec;
|
||||
mod str_beu32_codec;
|
||||
|
||||
pub use self::mtbl_codec::MtblCodec;
|
||||
pub use self::roaring_bitmap_codec::RoaringBitmapCodec;
|
||||
pub use self::str_beu32_codec::StrBEU32Codec;
|
||||
|
@ -1,21 +0,0 @@
|
||||
use std::borrow::Cow;
|
||||
use std::marker::PhantomData;
|
||||
use oxidized_mtbl::Reader;
|
||||
|
||||
pub struct MtblCodec<A>(PhantomData<A>);
|
||||
|
||||
impl<'a> heed::BytesDecode<'a> for MtblCodec<&'a [u8]> {
|
||||
type DItem = Reader<&'a [u8]>;
|
||||
|
||||
fn bytes_decode(bytes: &'a [u8]) -> Option<Self::DItem> {
|
||||
Reader::new(bytes).ok()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, A: AsRef<[u8]> + 'a> heed::BytesEncode<'a> for MtblCodec<A> {
|
||||
type EItem = Reader<A>;
|
||||
|
||||
fn bytes_encode(item: &Self::EItem) -> Option<Cow<[u8]>> {
|
||||
Some(Cow::Borrowed(item.as_bytes()))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user