aboutsummaryrefslogtreecommitdiff
path: root/src/block
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-23 11:33:38 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-23 11:33:38 +0100
commit93552b9275a6a83653353e27c0ee0c64c7a23d59 (patch)
tree378f0138abc09c3a99859e23498dbf38ba847625 /src/block
parent74d0c47f21ae2f9998a7dcbca3a27e3cc51e70b6 (diff)
downloadgarage-93552b9275a6a83653353e27c0ee0c64c7a23d59.tar.gz
garage-93552b9275a6a83653353e27c0ee0c64c7a23d59.zip
[refactor-block] Remove redundant BlockStream type
Diffstat (limited to 'src/block')
-rw-r--r--src/block/manager.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/block/manager.rs b/src/block/manager.rs
index 848d9141..96ea2c96 100644
--- a/src/block/manager.rs
+++ b/src/block/manager.rs
@@ -1,5 +1,4 @@
use std::path::PathBuf;
-use std::pin::Pin;
use std::sync::Arc;
use std::time::Duration;
@@ -9,7 +8,6 @@ use bytes::Bytes;
use rand::prelude::*;
use serde::{Deserialize, Serialize};
-use futures::Stream;
use futures_util::stream::StreamExt;
use tokio::fs;
use tokio::io::{AsyncReadExt, AsyncWriteExt, BufReader};
@@ -53,9 +51,6 @@ 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 {
@@ -327,7 +322,7 @@ impl BlockManager {
&self,
hash: &Hash,
order_tag: Option<OrderTag>,
- ) -> Result<BlockStream, Error> {
+ ) -> Result<ByteStream, Error> {
let (header, stream) = self.rpc_get_raw_block_streaming(hash, order_tag).await?;
match header {
DataBlockHeader::Plain => Ok(stream),