[pbs-devel] [PATCH proxmox-backup 05/15] async index reader: typedef ReadFuture
Fabian Grünbichler
f.gruenbichler at proxmox.com
Mon Jan 25 14:42:50 CET 2021
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
there is also still a FIXME here..
src/backup/async_index_reader.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/backup/async_index_reader.rs b/src/backup/async_index_reader.rs
index 60c68d4f..20a37e7e 100644
--- a/src/backup/async_index_reader.rs
+++ b/src/backup/async_index_reader.rs
@@ -15,6 +15,8 @@ use super::IndexFile;
use super::read_chunk::AsyncReadChunk;
use super::index::ChunkReadInfo;
+type ReadFuture<S> = dyn Future<Output = Result<(S, Vec<u8>), Error>> + Send + 'static;
+
// FIXME: This enum may not be required?
// - Put the `WaitForData` case directly into a `read_future: Option<>`
// - make the read loop as follows:
@@ -28,7 +30,7 @@ use super::index::ChunkReadInfo;
#[allow(clippy::enum_variant_names)]
enum AsyncIndexReaderState<S> {
NoData,
- WaitForData(Pin<Box<dyn Future<Output = Result<(S, Vec<u8>), Error>> + Send + 'static>>),
+ WaitForData(Pin<Box<ReadFuture<S>>>),
HaveData,
}
--
2.20.1
More information about the pbs-devel
mailing list