@@ -74,10 +74,12 @@ use futures_lite::{Stream, StreamExt};
74
74
use futures_util:: SinkExt ;
75
75
use genawaiter:: sync:: { Co , Gen } ;
76
76
use iroh_base:: { node_addr:: AddrInfoOptions , ticket:: BlobTicket } ;
77
+ pub use iroh_blobs:: net_protocol:: DownloadMode ;
77
78
use iroh_blobs:: {
78
79
export:: ExportProgress as BytesExportProgress ,
79
80
format:: collection:: { Collection , SimpleStore } ,
80
81
get:: db:: DownloadProgress as BytesDownloadProgress ,
82
+ net_protocol:: BlobDownloadRequest ,
81
83
store:: { BaoBlobSize , ConsistencyCheckProgress , ExportFormat , ExportMode , ValidateProgress } ,
82
84
util:: SetTagOption ,
83
85
BlobFormat , Hash , Tag ,
@@ -90,6 +92,7 @@ use serde::{Deserialize, Serialize};
90
92
use tokio:: io:: { AsyncRead , AsyncReadExt , ReadBuf } ;
91
93
use tokio_util:: io:: { ReaderStream , StreamReader } ;
92
94
use tracing:: warn;
95
+
93
96
mod batch;
94
97
pub use batch:: { AddDirOpts , AddFileOpts , AddReaderOpts , Batch } ;
95
98
@@ -98,8 +101,8 @@ use crate::rpc_protocol::{
98
101
blobs:: {
99
102
AddPathRequest , AddStreamRequest , AddStreamUpdate , BatchCreateRequest , BatchCreateResponse ,
100
103
BlobStatusRequest , ConsistencyCheckRequest , CreateCollectionRequest ,
101
- CreateCollectionResponse , DeleteRequest , DownloadRequest , ExportRequest ,
102
- ListIncompleteRequest , ListRequest , ReadAtRequest , ReadAtResponse , ValidateRequest ,
104
+ CreateCollectionResponse , DeleteRequest , ExportRequest , ListIncompleteRequest , ListRequest ,
105
+ ReadAtRequest , ReadAtResponse , ValidateRequest ,
103
106
} ,
104
107
node:: StatusRequest ,
105
108
} ;
@@ -357,7 +360,7 @@ impl Client {
357
360
} = opts;
358
361
let stream = self
359
362
. rpc
360
- . server_streaming ( DownloadRequest {
363
+ . server_streaming ( BlobDownloadRequest {
361
364
hash,
362
365
format,
363
366
nodes,
@@ -980,20 +983,6 @@ pub struct DownloadOptions {
980
983
pub mode : DownloadMode ,
981
984
}
982
985
983
- /// Set the mode for whether to directly start the download or add it to the download queue.
984
- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
985
- pub enum DownloadMode {
986
- /// Start the download right away.
987
- ///
988
- /// No concurrency limits or queuing will be applied. It is up to the user to manage download
989
- /// concurrency.
990
- Direct ,
991
- /// Queue the download.
992
- ///
993
- /// The download queue will be processed in-order, while respecting the downloader concurrency limits.
994
- Queued ,
995
- }
996
-
997
986
#[ cfg( test) ]
998
987
mod tests {
999
988
use iroh_blobs:: hashseq:: HashSeq ;
0 commit comments