@@ -74,10 +74,12 @@ use futures_lite::{Stream, StreamExt};
7474use futures_util:: SinkExt ;
7575use genawaiter:: sync:: { Co , Gen } ;
7676use iroh_base:: { node_addr:: AddrInfoOptions , ticket:: BlobTicket } ;
77+ pub use iroh_blobs:: net_protocol:: DownloadMode ;
7778use iroh_blobs:: {
7879 export:: ExportProgress as BytesExportProgress ,
7980 format:: collection:: { Collection , SimpleStore } ,
8081 get:: db:: DownloadProgress as BytesDownloadProgress ,
82+ net_protocol:: BlobDownloadRequest ,
8183 store:: { BaoBlobSize , ConsistencyCheckProgress , ExportFormat , ExportMode , ValidateProgress } ,
8284 util:: SetTagOption ,
8385 BlobFormat , Hash , Tag ,
@@ -90,6 +92,7 @@ use serde::{Deserialize, Serialize};
9092use tokio:: io:: { AsyncRead , AsyncReadExt , ReadBuf } ;
9193use tokio_util:: io:: { ReaderStream , StreamReader } ;
9294use tracing:: warn;
95+
9396mod batch;
9497pub use batch:: { AddDirOpts , AddFileOpts , AddReaderOpts , Batch } ;
9598
@@ -98,8 +101,8 @@ use crate::rpc_protocol::{
98101 blobs:: {
99102 AddPathRequest , AddStreamRequest , AddStreamUpdate , BatchCreateRequest , BatchCreateResponse ,
100103 BlobStatusRequest , ConsistencyCheckRequest , CreateCollectionRequest ,
101- CreateCollectionResponse , DeleteRequest , DownloadRequest , ExportRequest ,
102- ListIncompleteRequest , ListRequest , ReadAtRequest , ReadAtResponse , ValidateRequest ,
104+ CreateCollectionResponse , DeleteRequest , ExportRequest , ListIncompleteRequest , ListRequest ,
105+ ReadAtRequest , ReadAtResponse , ValidateRequest ,
103106 } ,
104107 node:: StatusRequest ,
105108} ;
@@ -357,7 +360,7 @@ impl Client {
357360 } = opts;
358361 let stream = self
359362 . rpc
360- . server_streaming ( DownloadRequest {
363+ . server_streaming ( BlobDownloadRequest {
361364 hash,
362365 format,
363366 nodes,
@@ -980,20 +983,6 @@ pub struct DownloadOptions {
980983 pub mode : DownloadMode ,
981984}
982985
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-
997986#[ cfg( test) ]
998987mod tests {
999988 use iroh_blobs:: hashseq:: HashSeq ;
0 commit comments