From 238692a8e7299b787c0b80c250d0cf8e96bf0649 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 22 Jun 2022 16:23:11 +0200 Subject: [PATCH] Introduce the copy_to_path method on the Index --- milli/src/index.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/milli/src/index.rs b/milli/src/index.rs index bb351d58f..d89246dd8 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -1,11 +1,12 @@ use std::borrow::Cow; use std::collections::{HashMap, HashSet}; +use std::fs::File; use std::mem::size_of; use std::path::Path; use heed::flags::Flags; use heed::types::*; -use heed::{Database, PolyDatabase, RoTxn, RwTxn}; +use heed::{CompactionOption, Database, PolyDatabase, RoTxn, RwTxn}; use roaring::RoaringBitmap; use rstar::RTree; use time::OffsetDateTime; @@ -214,6 +215,10 @@ impl Index { self.env.path() } + pub fn copy_to_path>(&self, path: P, option: CompactionOption) -> Result { + self.env.copy_to_path(path, option).map_err(Into::into) + } + /// Returns an `EnvClosingEvent` that can be used to wait for the closing event, /// multiple threads can wait on this event. ///