From 2a50e08bb896a1ef2529439db2709b393227ee30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Mon, 4 Nov 2019 10:49:27 +0100 Subject: [PATCH] Moving to heed v0.5.0 --- meilidb-core/Cargo.toml | 2 +- meilidb-core/src/database.rs | 2 +- meilidb-core/src/serde/serializer.rs | 22 +++++++++---------- meilidb-core/src/update/documents_addition.rs | 4 ++-- meilidb-core/src/update/mod.rs | 4 ++-- meilidb-http/Cargo.toml | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/meilidb-core/Cargo.toml b/meilidb-core/Cargo.toml index 751c1144b..e0d9a8fd1 100644 --- a/meilidb-core/Cargo.toml +++ b/meilidb-core/Cargo.toml @@ -12,7 +12,7 @@ crossbeam-channel = "0.3.9" deunicode = "1.0.0" env_logger = "0.7.0" hashbrown = { version = "0.6.0", features = ["serde"] } -heed = "0.3.1" +heed = "0.5.0" log = "0.4.8" meilidb-schema = { path = "../meilidb-schema", version = "0.6.0" } meilidb-tokenizer = { path = "../meilidb-tokenizer", version = "0.6.0" } diff --git a/meilidb-core/src/database.rs b/meilidb-core/src/database.rs index d2280dd48..38f483f01 100644 --- a/meilidb-core/src/database.rs +++ b/meilidb-core/src/database.rs @@ -46,7 +46,7 @@ fn update_awaiter(receiver: Receiver<()>, env: heed::Env, update_fn: Arc writer, Err(e) => { error!("LMDB nested write transaction begin failed: {}", e); diff --git a/meilidb-core/src/serde/serializer.rs b/meilidb-core/src/serde/serializer.rs index 34f54d655..36c403390 100644 --- a/meilidb-core/src/serde/serializer.rs +++ b/meilidb-core/src/serde/serializer.rs @@ -7,8 +7,8 @@ use crate::{DocumentId, RankedMap}; use super::{ConvertToNumber, ConvertToString, Indexer, SerializerError}; -pub struct Serializer<'a> { - pub txn: &'a mut heed::RwTxn, +pub struct Serializer<'a, 'b> { + pub txn: &'a mut heed::RwTxn<'b>, pub schema: &'a Schema, pub document_store: DocumentsFields, pub document_fields_counts: DocumentsFieldsCounts, @@ -17,15 +17,15 @@ pub struct Serializer<'a> { pub document_id: DocumentId, } -impl<'a> ser::Serializer for Serializer<'a> { +impl<'a, 'b> ser::Serializer for Serializer<'a, 'b> { type Ok = (); type Error = SerializerError; type SerializeSeq = ser::Impossible; type SerializeTuple = ser::Impossible; type SerializeTupleStruct = ser::Impossible; type SerializeTupleVariant = ser::Impossible; - type SerializeMap = MapSerializer<'a>; - type SerializeStruct = StructSerializer<'a>; + type SerializeMap = MapSerializer<'a, 'b>; + type SerializeStruct = StructSerializer<'a, 'b>; type SerializeStructVariant = ser::Impossible; forward_to_unserializable_type! { @@ -190,8 +190,8 @@ impl<'a> ser::Serializer for Serializer<'a> { } } -pub struct MapSerializer<'a> { - txn: &'a mut heed::RwTxn, +pub struct MapSerializer<'a, 'b> { + txn: &'a mut heed::RwTxn<'b>, schema: &'a Schema, document_id: DocumentId, document_store: DocumentsFields, @@ -201,7 +201,7 @@ pub struct MapSerializer<'a> { current_key_name: Option, } -impl<'a> ser::SerializeMap for MapSerializer<'a> { +impl<'a, 'b> ser::SerializeMap for MapSerializer<'a, 'b> { type Ok = (); type Error = SerializerError; @@ -253,8 +253,8 @@ impl<'a> ser::SerializeMap for MapSerializer<'a> { } } -pub struct StructSerializer<'a> { - txn: &'a mut heed::RwTxn, +pub struct StructSerializer<'a, 'b> { + txn: &'a mut heed::RwTxn<'b>, schema: &'a Schema, document_id: DocumentId, document_store: DocumentsFields, @@ -263,7 +263,7 @@ pub struct StructSerializer<'a> { ranked_map: &'a mut RankedMap, } -impl<'a> ser::SerializeStruct for StructSerializer<'a> { +impl<'a, 'b> ser::SerializeStruct for StructSerializer<'a, 'b> { type Ok = (); type Error = SerializerError; diff --git a/meilidb-core/src/update/documents_addition.rs b/meilidb-core/src/update/documents_addition.rs index 1806e3063..8aa5468d7 100644 --- a/meilidb-core/src/update/documents_addition.rs +++ b/meilidb-core/src/update/documents_addition.rs @@ -77,8 +77,8 @@ pub fn push_documents_addition( Ok(last_update_id) } -pub fn apply_documents_addition( - writer: &mut heed::RwTxn, +pub fn apply_documents_addition<'a, 'b>( + writer: &'a mut heed::RwTxn<'b>, main_store: store::Main, documents_fields_store: store::DocumentsFields, documents_fields_counts_store: store::DocumentsFieldsCounts, diff --git a/meilidb-core/src/update/mod.rs b/meilidb-core/src/update/mod.rs index 64d85c088..52d8ab3d5 100644 --- a/meilidb-core/src/update/mod.rs +++ b/meilidb-core/src/update/mod.rs @@ -149,8 +149,8 @@ pub fn next_update_id( Ok(new_update_id) } -pub fn update_task( - writer: &mut heed::RwTxn, +pub fn update_task<'a, 'b>( + writer: &'a mut heed::RwTxn<'b>, index: store::Index, update_id: u64, update: Update, diff --git a/meilidb-http/Cargo.toml b/meilidb-http/Cargo.toml index 02c8fdcb4..3887bd775 100644 --- a/meilidb-http/Cargo.toml +++ b/meilidb-http/Cargo.toml @@ -13,7 +13,7 @@ chrono = { version = "0.4.9", features = ["serde"] } crossbeam-channel = "0.3.9" envconfig = "0.5.1" envconfig_derive = "0.5.1" -heed = "0.3.1" +heed = "0.5.0" http = "0.1.19" indexmap = { version = "1.3.0", features = ["serde-1"] } jemallocator = "0.3.2"