mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Move to heed 0.1.0
This commit is contained in:
parent
6c9a238973
commit
78535b3e33
23 changed files with 132 additions and 176 deletions
|
@ -14,7 +14,7 @@ use crate::DocumentId;
|
|||
#[derive(Debug)]
|
||||
pub enum DeserializerError {
|
||||
SerdeJson(SerdeJsonError),
|
||||
Zlmdb(zlmdb::Error),
|
||||
Zlmdb(heed::Error),
|
||||
Custom(String),
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ impl fmt::Display for DeserializerError {
|
|||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
DeserializerError::SerdeJson(e) => write!(f, "serde json related error: {}", e),
|
||||
DeserializerError::Zlmdb(e) => write!(f, "zlmdb related error: {}", e),
|
||||
DeserializerError::Zlmdb(e) => write!(f, "heed related error: {}", e),
|
||||
DeserializerError::Custom(s) => f.write_str(s),
|
||||
}
|
||||
}
|
||||
|
@ -42,15 +42,15 @@ impl From<SerdeJsonError> for DeserializerError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<zlmdb::Error> for DeserializerError {
|
||||
fn from(error: zlmdb::Error) -> DeserializerError {
|
||||
impl From<heed::Error> for DeserializerError {
|
||||
fn from(error: heed::Error) -> DeserializerError {
|
||||
DeserializerError::Zlmdb(error)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Deserializer<'a> {
|
||||
pub document_id: DocumentId,
|
||||
pub reader: &'a zlmdb::RoTxn,
|
||||
pub reader: &'a heed::RoTxn,
|
||||
pub documents_fields: DocumentsFields,
|
||||
pub schema: &'a Schema,
|
||||
pub attributes: Option<&'a HashSet<SchemaAttr>>,
|
||||
|
|
|
@ -35,7 +35,7 @@ use crate::{DocumentId, ParseNumberError};
|
|||
pub enum SerializerError {
|
||||
DocumentIdNotFound,
|
||||
InvalidDocumentIdType,
|
||||
Zlmdb(zlmdb::Error),
|
||||
Zlmdb(heed::Error),
|
||||
SerdeJson(SerdeJsonError),
|
||||
ParseNumber(ParseNumberError),
|
||||
UnserializableType { type_name: &'static str },
|
||||
|
@ -59,7 +59,7 @@ impl fmt::Display for SerializerError {
|
|||
SerializerError::InvalidDocumentIdType => {
|
||||
f.write_str("document identifier can only be of type string or number")
|
||||
}
|
||||
SerializerError::Zlmdb(e) => write!(f, "zlmdb related error: {}", e),
|
||||
SerializerError::Zlmdb(e) => write!(f, "heed related error: {}", e),
|
||||
SerializerError::SerdeJson(e) => write!(f, "serde json error: {}", e),
|
||||
SerializerError::ParseNumber(e) => {
|
||||
write!(f, "error while trying to parse a number: {}", e)
|
||||
|
@ -92,8 +92,8 @@ impl From<SerdeJsonError> for SerializerError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<zlmdb::Error> for SerializerError {
|
||||
fn from(error: zlmdb::Error) -> SerializerError {
|
||||
impl From<heed::Error> for SerializerError {
|
||||
fn from(error: heed::Error) -> SerializerError {
|
||||
SerializerError::Zlmdb(error)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue