diff options
author | Alex Auvolat <alex@adnab.me> | 2023-01-03 15:08:37 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-01-03 15:08:37 +0100 |
commit | 426d8784dac0e39879af52d980887d3692fc907c (patch) | |
tree | a5bf205a5e8cd013e98cc88fe57aeaeebb86e30b /src/table/schema.rs | |
parent | a81200d345e23b93b8f6e1d879b6b14efbdfb2bb (diff) | |
download | garage-426d8784dac0e39879af52d980887d3692fc907c.tar.gz garage-426d8784dac0e39879af52d980887d3692fc907c.zip |
cleanup
Diffstat (limited to 'src/table/schema.rs')
-rw-r--r-- | src/table/schema.rs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/table/schema.rs b/src/table/schema.rs index 6538a32f..5cbf6c95 100644 --- a/src/table/schema.rs +++ b/src/table/schema.rs @@ -7,7 +7,9 @@ use garage_util::migrate::Migrate; use crate::crdt::Crdt; /// Trait for field used to partition data -pub trait PartitionKey { +pub trait PartitionKey: + Clone + PartialEq + Serialize + for<'de> Deserialize<'de> + Send + Sync + 'static +{ /// Get the key used to partition fn hash(&self) -> Hash; } @@ -28,7 +30,7 @@ impl PartitionKey for FixedBytes32 { } /// Trait for field used to sort data -pub trait SortKey { +pub trait SortKey: Clone + Serialize + for<'de> Deserialize<'de> + Send + Sync + 'static { /// Get the key used to sort fn sort_key(&self) -> &[u8]; } @@ -66,16 +68,9 @@ pub trait TableSchema: Send + Sync + 'static { const TABLE_NAME: &'static str; /// The partition key used in that table - type P: PartitionKey - + Clone - + PartialEq - + Serialize - + for<'de> Deserialize<'de> - + Send - + Sync - + 'static; + type P: PartitionKey; /// The sort key used int that table - type S: SortKey + Clone + Serialize + for<'de> Deserialize<'de> + Send + Sync + 'static; + type S: SortKey; /// They type for an entry in that table type E: Entry<Self::P, Self::S>; |