-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add an `Update` trait to `bee_storage::access` * test the `Update` access operation * implement `Update` for `bee-storage-memory` * implement `Update` for `bee-storage-null` * implement `Update` for `bee-storage-sled` * implement `Update` for `bee-storage-rocksdb` * fix punctuation * bump `bee-storage-*` crates versions * simplify `update` for `bee-storage-memory` * nits * Update bee-storage/bee-storage-test/src/message_id_to_metadata.rs * fmt Co-authored-by: Thibault Martinez <thibault.martinez.30@gmail.com>
- Loading branch information
1 parent
b431dc2
commit 45977c8
Showing
40 changed files
with
457 additions
and
86 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
|
@@ -11,3 +11,4 @@ pub mod insert; | |
pub mod iter; | ||
pub mod multi_fetch; | ||
pub mod truncate; | ||
pub mod update; |
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,22 @@ | ||
// Copyright 2021-2022 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//! Update access operations. | ||
|
||
use crate::storage::Storage; | ||
|
||
use bee_message::MessageId; | ||
use bee_storage::{access::Update, backend::StorageBackend}; | ||
use bee_tangle::metadata::MessageMetadata; | ||
|
||
macro_rules! impl_update { | ||
($key:ty, $value:ty, $field:ident) => { | ||
impl Update<$key, $value> for Storage { | ||
fn update(&self, k: &$key, f: impl FnMut(&mut $value)) -> Result<(), <Self as StorageBackend>::Error> { | ||
Ok(self.inner.write()?.$field.update(k, f)) | ||
} | ||
} | ||
}; | ||
} | ||
|
||
impl_update!(MessageId, MessageMetadata, message_id_to_metadata); |
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
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 |
---|---|---|
|
@@ -9,3 +9,4 @@ pub mod insert; | |
pub mod iter; | ||
pub mod multi_fetch; | ||
pub mod truncate; | ||
pub mod update; |
Oops, something went wrong.