-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from meilisearch/a-new-era
Rework heed to be lightweight and simpler to maintain
- Loading branch information
Showing
56 changed files
with
3,191 additions
and
1,688 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
heed/target | ||
**/*.rs.bk | ||
Cargo.lock | ||
/*.mdb | ||
*.mdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "lmdb-master-sys/lmdb"] | ||
path = lmdb-master-sys/lmdb | ||
url = https://github.com/LMDB/lmdb | ||
branch = mdb.master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[workspace] | ||
members = ["heed", "heed-traits", "heed-types"] | ||
members = ["lmdb-master-sys", "heed", "heed-traits", "heed-types"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
[package] | ||
name = "heed-traits" | ||
version = "0.7.0" | ||
version = "0.20.0-alpha.0" | ||
authors = ["Kerollmops <[email protected]>"] | ||
description = "The traits used inside of the fully typed LMDB wrapper, heed" | ||
license = "MIT" | ||
repository = "https://github.com/Kerollmops/heed" | ||
readme = "../README.md" | ||
edition = "2018" | ||
edition = "2021" | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
use std::borrow::Cow; | ||
use std::error::Error as StdError; | ||
|
||
/// A boxed `Send + Sync + 'static` error. | ||
pub type BoxedError = Box<dyn StdError + Send + Sync + 'static>; | ||
|
||
/// A trait that represents an encoding structure. | ||
pub trait BytesEncode<'a> { | ||
type EItem: ?Sized + 'a; | ||
|
||
fn bytes_encode(item: &'a Self::EItem) -> Option<Cow<'a, [u8]>>; | ||
fn bytes_encode(item: &'a Self::EItem) -> Result<Cow<'a, [u8]>, BoxedError>; | ||
} | ||
|
||
/// A trait that represents a decoding structure. | ||
pub trait BytesDecode<'a> { | ||
type DItem: 'a; | ||
|
||
fn bytes_decode(bytes: &'a [u8]) -> Option<Self::DItem>; | ||
fn bytes_decode(bytes: &'a [u8]) -> Result<Self::DItem, BoxedError>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
[package] | ||
name = "heed-types" | ||
version = "0.7.2" | ||
version = "0.20.0-alpha.0" | ||
authors = ["Kerollmops <[email protected]>"] | ||
description = "The types used with the fully typed LMDB wrapper, heed" | ||
license = "MIT" | ||
repository = "https://github.com/Kerollmops/heed" | ||
readme = "../README.md" | ||
edition = "2018" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
bincode = { version = "1.2.1", optional = true } | ||
heed-traits = { version = "0.7.0", path = "../heed-traits" } | ||
serde = { version = "1.0.117", optional = true } | ||
serde_json = { version = "1.0.59", optional = true } | ||
zerocopy = "0.3.0" | ||
bincode = { version = "1.3.3", optional = true } | ||
bytemuck = { version = "1.12.3", features = ["extern_crate_alloc", "extern_crate_std"] } | ||
byteorder = "1.4.3" | ||
heed-traits = { version = "0.20.0-alpha.0", path = "../heed-traits" } | ||
serde = { version = "1.0.151", optional = true } | ||
serde_json = { version = "1.0.91", optional = true } | ||
|
||
[dev-dependencies] | ||
rand = "0.8.5" | ||
|
||
[features] | ||
default = ["serde-bincode", "serde-json"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.