sapling/eden/mononoke/blobstore/Cargo.toml

37 lines
1.0 KiB
TOML
Raw Normal View History

[package]
name = "blobstore"
edition = "2018"
version = "0.1.0"
authors = ['Facebook']
license = "GPLv2+"
include = ["src/**/*.rs", "test/**/*.rs"]
[lib]
path = "src/lib.rs"
[[test]]
name = "blobstore_test"
path = "test/main.rs"
[dependencies]
context = { path = "../server/context" }
stats = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
abomonation = "0.7"
abomonation_derive = "0.5"
anyhow = "1.0"
auto_impl = { git = "https://github.com/auto-impl-rs/auto_impl", rev = "43ad0ed49f67168b2971b271481e75afac589b24" }
mononoke: update internals to Bytes 0.5 Summary: The Bytes 0.5 update left us in a somewhat undesirable position where every access to our blobstore incurs an extra copy whenever we fetch data out of our cache (by turning it from Bytes 0.5 into Bytes 0.4) — we also have quite a few place where we convert in one direction then immediately into the other. Internally, we can start using Bytes 0.5 now. For example, this is useful when pulling data out of our blobstore and deserializing as Thrift (or conversely, when serializing and putting it into our blobstore). However, when we interface with Tokio (i.e. decoders & encoders), we still have to use Bytes 0.4. So, when needed, we convert our Bytes 0.5 to 0.4 there. The tradeoff idea is that we deal with more bytes internally than we end up sending to clients, so doing the Bytes conversion closer to the point of sending data to clients means less copies. We can also start removing those once we migrate to Tokio 0.2 (and newer versions of Hyper for HTTP services). Changes that were required: - You can't extend new bytes (because that implicitly copies). You need to use BytesMut instead, which I did where that was necessary (I also added calls in the Filestore to do that efficiently). - You can't create bytes from a `&'a [u8]`, unless `'a` is `'static`. You need to use `copy_from_slice` instead. - `slice_to` and `slice_from` have been replaced by a `slice()` function that takes ranges. Reviewed By: StanislavGlebik Differential Revision: D20121350 fbshipit-source-id: eb31af2051fd8c9d31c69b502e2f6f1ce2190cb1
2020-02-27 19:04:39 +03:00
bytes = { version = "0.5", features = ["serde"] }
futures = { version = "0.3.5", features = ["async-await", "compat"] }
futures-old = { package = "futures", version = "0.1" }
thiserror = "1.0"
zstd = "=0.4.23"
[dev-dependencies]
cacheblob = { path = "cacheblob" }
fileblob = { path = "fileblob" }
memblob = { path = "memblob" }
mononoke_types = { path = "../mononoke_types" }
fbinit = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
tempdir = "0.3"
tokio-compat = "0.1"