Create two open and create index functions

This commit is contained in:
Clément Renault
2019-10-10 13:38:58 +02:00
parent 0103c7bfd9
commit 19c22a8c5e
4 changed files with 57 additions and 39 deletions

View File

@ -6,6 +6,7 @@ pub type MResult<T> = Result<T, Error>;
#[derive(Debug)]
pub enum Error {
Io(io::Error),
IndexAlreadyExists,
SchemaDiffer,
SchemaMissing,
WordIndexMissing,
@ -79,6 +80,7 @@ impl fmt::Display for Error {
use self::Error::*;
match self {
Io(e) => write!(f, "{}", e),
IndexAlreadyExists => write!(f, "index already exists"),
SchemaDiffer => write!(f, "schemas differ"),
SchemaMissing => write!(f, "this index does not have a schema"),
WordIndexMissing => write!(f, "this index does not have a word index"),