diff options
author | Quentin <quentin@deuxfleurs.fr> | 2020-12-14 21:46:49 +0100 |
---|---|---|
committer | Quentin <quentin@deuxfleurs.fr> | 2020-12-14 21:46:49 +0100 |
commit | d0eb6a457f6f83c8f49d262adf6150964a1249b2 (patch) | |
tree | 4b2437a69e11855f83a7a2ac9555372fa54121e1 /src/model/bucket_table.rs | |
parent | 96388acf230d48877a037b21931f61e2c63d2574 (diff) | |
download | garage-d0eb6a457f6f83c8f49d262adf6150964a1249b2.tar.gz garage-d0eb6a457f6f83c8f49d262adf6150964a1249b2.zip |
Migrate RPC to new schema
Diffstat (limited to 'src/model/bucket_table.rs')
-rw-r--r-- | src/model/bucket_table.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/model/bucket_table.rs b/src/model/bucket_table.rs index 08d0d168..609490cb 100644 --- a/src/model/bucket_table.rs +++ b/src/model/bucket_table.rs @@ -55,14 +55,20 @@ impl CRDT for BucketParams { } } +impl BucketParams { + pub fn new() -> Self { + BucketParams { + authorized_keys: crdt::LWWMap::new(), + website: crdt::LWW::new(false) + } + } +} + impl Bucket { pub fn new(name: String) -> Self { Bucket { name, - state: crdt::LWW::new(BucketState::Present(BucketParams { - authorized_keys: crdt::LWWMap::new(), - website: crdt::LWW::new(false) - })), + state: crdt::LWW::new(BucketState::Present(BucketParams::new())), } } pub fn is_deleted(&self) -> bool { |