Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Commit 4561e1c

Browse files
committed
Make encode/decode bounds non-default.
1 parent 2cb7f0a commit 4561e1c

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ jobs:
267267
uses: actions-rs/cargo@v1
268268
with:
269269
command: rustdoc
270-
args: --all-features -- -D warnings --cfg docsrs
270+
args: ${{ env.ALMOST_ALL_FEATURES }} -- -D warnings --cfg docsrs
271271

272272
udeps:
273273
name: Unused Dependencies
@@ -297,4 +297,4 @@ jobs:
297297
uses: actions-rs/cargo@v1
298298
with:
299299
command: udeps
300-
args: --all --all-features --all-targets
300+
args: --all ${{ env.ALMOST_ALL_FEATURES }} --all-targets

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rustdoc-args = ["--cfg", "docsrs"]
1212
# Note: If you add a feature, adjust the ALMOST_ALL_FEATURES environment variable in
1313
# main.yml and coverage.yml:
1414
default = ["with-serde"]
15-
persistence = []
15+
persistence = ["rocksdb", "uuid"]
1616
with-serde = ["serde"]
1717
with-csv = ["csv"]
1818
with-nexmark = [
@@ -52,9 +52,9 @@ paste = { version = "1.0.9", optional = true }
5252
bitvec = "1.0.1"
5353
xxhash-rust = { version = "0.8.6", features = ["xxh3"] }
5454
crossbeam = "0.8.2"
55-
rocksdb = { version = "0.19", default-features = false, features = ["multi-threaded-cf"] }
55+
rocksdb = { version = "0.19", default-features = false, features = ["multi-threaded-cf"], optional = true }
5656
bincode = "2.0.0-rc.2"
57-
uuid = { version = "1.1.2", features = ["v4"] }
57+
uuid = { version = "1.1.2", features = ["v4"], optional = true }
5858

5959
# TODO: Remove these dependencies
6060
rand = { version = "0.8", optional = true }

src/trace/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub mod consolidation;
1414
pub mod cursor;
1515
pub mod layers;
1616
pub mod ord;
17+
#[cfg(feature = "persistence")]
1718
pub mod persistent;
1819
// We export the `spine_fueled` module only for testing (so we can explicitly
1920
// choose the in-memory DS). For regular logic, since we replace it with the
@@ -30,6 +31,7 @@ use crate::{
3031
time::{AntichainRef, Timestamp},
3132
NumEntries,
3233
};
34+
#[cfg(feature = "persistence")]
3335
use bincode::{Decode, Encode};
3436
pub use cursor::{Consumer, Cursor, ValueConsumer};
3537
#[cfg(feature = "persistence")]
@@ -46,15 +48,30 @@ use std::{fmt::Debug, hash::Hash};
4648
/// must be generic over any relational data, it is sufficient to impose
4749
/// `DBData` as a trait bound on types. Conversely, a trait bound of the form
4850
/// `B: BatchReader` implies `B::Key: DBData` and `B::Val: DBData`.
51+
#[cfg(feature = "persistence")]
4952
pub trait DBData:
5053
Clone + Eq + Ord + Hash + SizeOf + Send + Debug + Decode + Encode + 'static
5154
{
5255
}
56+
57+
#[cfg(not(feature = "persistence"))]
58+
pub trait DBData:
59+
Clone + Eq + Ord + Hash + SizeOf + Send + Debug + 'static
60+
{
61+
}
62+
63+
#[cfg(feature = "persistence")]
5364
impl<T> DBData for T where
5465
T: Clone + Eq + Ord + Hash + SizeOf + Send + Debug + Decode + Encode + 'static
5566
{
5667
}
5768

69+
#[cfg(not(feature = "persistence"))]
70+
impl<T> DBData for T where
71+
T: Clone + Eq + Ord + Hash + SizeOf + Send + Debug + 'static
72+
{
73+
}
74+
5875
/// Trait for data types used as weights.
5976
///
6077
/// A type used for weights in a batch (i.e., as `BatchReader::R`) must behave

0 commit comments

Comments
 (0)