diff options
author | Alex Auvolat <alex@adnab.me> | 2024-02-05 20:26:33 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2024-02-05 20:26:33 +0100 |
commit | 22332e6c3536159656e773a85d656352882ffc32 (patch) | |
tree | 583d9d7b3ae3d053ca66367bcb5cc52d97f68839 /src/block/manager.rs | |
parent | 81ccd4586ebdf707dfd37d4802e0cf475e11e004 (diff) | |
download | garage-22332e6c3536159656e773a85d656352882ffc32.tar.gz garage-22332e6c3536159656e773a85d656352882ffc32.zip |
[dep-upgrade-202402] simplify/refactor GetObject
Diffstat (limited to 'src/block/manager.rs')
-rw-r--r-- | src/block/manager.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/block/manager.rs b/src/block/manager.rs index 2d1b5c67..5388f69d 100644 --- a/src/block/manager.rs +++ b/src/block/manager.rs @@ -53,6 +53,9 @@ pub const INLINE_THRESHOLD: usize = 3072; // to delete the block locally. pub(crate) const BLOCK_GC_DELAY: Duration = Duration::from_secs(600); +pub type BlockStream = + Pin<Box<dyn Stream<Item = Result<Bytes, std::io::Error>> + Send + Sync + 'static>>; + /// RPC messages used to share blocks of data between nodes #[derive(Debug, Serialize, Deserialize)] pub enum BlockRpc { @@ -324,10 +327,7 @@ impl BlockManager { &self, hash: &Hash, order_tag: Option<OrderTag>, - ) -> Result< - Pin<Box<dyn Stream<Item = Result<Bytes, std::io::Error>> + Send + Sync + 'static>>, - Error, - > { + ) -> Result<BlockStream, Error> { let (header, stream) = self.rpc_get_raw_block_streaming(hash, order_tag).await?; match header { DataBlockHeader::Plain => Ok(stream), |