Skip to content

Commit 3121b0d

Browse files
committed
undo get -> fetch rename
not worth it at this point
1 parent 03d2f8a commit 3121b0d

File tree

18 files changed

+44
-44
lines changed

18 files changed

+44
-44
lines changed

examples/fetch-fsm.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::net::SocketAddr;
77

88
use anyhow::{Context, Result};
99
use iroh_blobs::{
10-
fetch::fsm::{AtInitial, ConnectedNext, EndBlobNext},
10+
get::fsm::{AtInitial, ConnectedNext, EndBlobNext},
1111
hashseq::HashSeq,
1212
protocol::GetRequest,
1313
Hash,
@@ -63,14 +63,14 @@ async fn main() -> Result<()> {
6363
// create a request for a collection
6464
let request = GetRequest::all(hash);
6565
// create the initial state of the finite state machine
66-
let initial = iroh_blobs::fetch::fsm::start(connection, request);
66+
let initial = iroh_blobs::get::fsm::start(connection, request);
6767

6868
write_collection(initial).await
6969
} else {
7070
// create a request for a single blob
7171
let request = GetRequest::single(hash);
7272
// create the initial state of the finite state machine
73-
let initial = iroh_blobs::fetch::fsm::start(connection, request);
73+
let initial = iroh_blobs::get::fsm::start(connection, request);
7474

7575
write_blob(initial).await
7676
}
@@ -119,7 +119,7 @@ async fn write_collection(initial: AtInitial) -> Result<()> {
119119
}
120120

121121
// move to the header
122-
let header: iroh_blobs::fetch::fsm::AtBlobHeader = start_root.next();
122+
let header: iroh_blobs::get::fsm::AtBlobHeader = start_root.next();
123123
let (root_end, hashes_bytes) = header.concatenate_into_vec().await?;
124124
let next = root_end.next();
125125
let EndBlobNext::MoreChildren(at_meta) = next else {

examples/fetch-stream.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use bytes::Bytes;
1111
use futures_lite::{Stream, StreamExt};
1212
use genawaiter::sync::{Co, Gen};
1313
use iroh_blobs::{
14-
fetch::fsm::{AtInitial, BlobContentNext, ConnectedNext, EndBlobNext},
14+
get::fsm::{AtInitial, BlobContentNext, ConnectedNext, EndBlobNext},
1515
hashseq::HashSeq,
1616
protocol::GetRequest,
1717
Hash,
@@ -68,7 +68,7 @@ async fn main() -> Result<()> {
6868
let request = GetRequest::all(hash);
6969

7070
// create the initial state of the finite state machine
71-
let initial = iroh_blobs::fetch::fsm::start(connection, request);
71+
let initial = iroh_blobs::get::fsm::start(connection, request);
7272

7373
// create a stream that yields all the data of the blob
7474
stream_children(initial).boxed_local()
@@ -77,7 +77,7 @@ async fn main() -> Result<()> {
7777
let request = GetRequest::single(hash);
7878

7979
// create the initial state of the finite state machine
80-
let initial = iroh_blobs::fetch::fsm::start(connection, request);
80+
let initial = iroh_blobs::get::fsm::start(connection, request);
8181

8282
// create a stream that yields all the data of the blob
8383
stream_blob(initial).boxed_local()
@@ -166,7 +166,7 @@ fn stream_children(initial: AtInitial) -> impl Stream<Item = io::Result<Bytes>>
166166
));
167167
}
168168
// move to the header
169-
let header: iroh_blobs::fetch::fsm::AtBlobHeader = start_root.next();
169+
let header: iroh_blobs::get::fsm::AtBlobHeader = start_root.next();
170170
let (root_end, hashes_bytes) = header.concatenate_into_vec().await?;
171171

172172
// parse the hashes from the hash sequence bytes

examples/local-swarm-discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ mod progress {
140140
ProgressStyle,
141141
};
142142
use iroh_blobs::{
143-
fetch::{
143+
get::{
144144
progress::{BlobProgress, DownloadProgress},
145145
Stats,
146146
},

src/downloader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use tokio_util::{either::Either, sync::CancellationToken, time::delay_queue};
5555
use tracing::{debug, error, error_span, trace, warn, Instrument};
5656

5757
use crate::{
58-
fetch::{progress::DownloadProgress, Stats},
58+
get::{progress::DownloadProgress, Stats},
5959
metrics::Metrics,
6060
store::Store,
6161
util::{local_pool::LocalPoolHandle, progress::ProgressSender},

src/downloader/get.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use iroh::endpoint;
77

88
use super::{progress::BroadcastProgressSender, DownloadKind, FailureAction, GetStartFut, Getter};
99
use crate::{
10-
fetch::Error,
11-
store::{fetch_to_db_in_steps, FetchState, FetchStateNeedsConn, Store},
10+
get::Error,
11+
store::{get_to_db_in_steps, FetchState, FetchStateNeedsConn, Store},
1212
};
1313

1414
impl From<Error> for FailureAction {
@@ -43,7 +43,7 @@ impl<S: Store> Getter for IoGetter<S> {
4343
) -> GetStartFut<Self::NeedsConn> {
4444
let store = self.store.clone();
4545
async move {
46-
match fetch_to_db_in_steps(store, kind.hash_and_format(), progress_sender).await {
46+
match get_to_db_in_steps(store, kind.hash_and_format(), progress_sender).await {
4747
Err(err) => Err(err.into()),
4848
Ok(FetchState::Complete(stats)) => Ok(super::GetOutput::Complete(stats)),
4949
Ok(FetchState::NeedsConn(needs_conn)) => {
@@ -71,13 +71,13 @@ impl super::NeedsConn<endpoint::Connection> for FetchStateNeedsConn {
7171
}
7272

7373
#[cfg(feature = "metrics")]
74-
fn track_metrics(res: &Result<crate::fetch::Stats, Error>) {
74+
fn track_metrics(res: &Result<crate::get::Stats, Error>) {
7575
use iroh_metrics::{inc, inc_by};
7676

7777
use crate::metrics::Metrics;
7878
match res {
7979
Ok(stats) => {
80-
let crate::fetch::Stats {
80+
let crate::get::Stats {
8181
bytes_written,
8282
bytes_read: _,
8383
elapsed,

src/downloader/progress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use parking_lot::Mutex;
1111

1212
use super::DownloadKind;
1313
use crate::{
14-
fetch::progress::{DownloadProgress, TransferState},
14+
get::progress::{DownloadProgress, TransferState},
1515
util::progress::{AsyncChannelProgressSender, IdGenerator, ProgressSendError, ProgressSender},
1616
};
1717

src/downloader/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use iroh::SecretKey;
1010

1111
use super::*;
1212
use crate::{
13-
fetch::progress::{BlobId, BlobProgress, TransferState},
13+
get::progress::{BlobId, BlobProgress, TransferState},
1414
util::{
1515
local_pool::LocalPool,
1616
progress::{AsyncChannelProgressSender, IdGenerator},

src/format/collection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use iroh_io::AsyncSliceReaderExt;
88
use serde::{Deserialize, Serialize};
99

1010
use crate::{
11-
fetch::{fsm, Stats},
11+
get::{fsm, Stats},
1212
hashseq::HashSeq,
1313
store::MapEntry,
1414
util::TempTag,
@@ -142,7 +142,7 @@ impl Collection {
142142
///
143143
/// Returns the collection, a map from blob offsets to bytes, and the stats.
144144
pub async fn read_fsm_all(
145-
fsm_at_start_root: crate::fetch::fsm::AtStartRoot,
145+
fsm_at_start_root: crate::get::fsm::AtStartRoot,
146146
) -> anyhow::Result<(Collection, BTreeMap<u64, Bytes>, Stats)> {
147147
let (next, links, collection) = Self::read_fsm(fsm_at_start_root).await?;
148148
let mut res = BTreeMap::new();

src/fetch.rs renamed to src/get.rs

File renamed without changes.

src/fetch/error.rs renamed to src/get/error.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ impl From<endpoint::WriteError> for Error {
116116
}
117117
}
118118

119-
impl From<crate::fetch::fsm::ConnectedNextError> for Error {
120-
fn from(value: crate::fetch::fsm::ConnectedNextError) -> Self {
121-
use crate::fetch::fsm::ConnectedNextError::*;
119+
impl From<crate::get::fsm::ConnectedNextError> for Error {
120+
fn from(value: crate::get::fsm::ConnectedNextError) -> Self {
121+
use crate::get::fsm::ConnectedNextError::*;
122122
match value {
123123
e @ PostcardSer(_) => {
124124
// serialization errors indicate something wrong with the request itself
@@ -138,9 +138,9 @@ impl From<crate::fetch::fsm::ConnectedNextError> for Error {
138138
}
139139
}
140140

141-
impl From<crate::fetch::fsm::AtBlobHeaderNextError> for Error {
142-
fn from(value: crate::fetch::fsm::AtBlobHeaderNextError) -> Self {
143-
use crate::fetch::fsm::AtBlobHeaderNextError::*;
141+
impl From<crate::get::fsm::AtBlobHeaderNextError> for Error {
142+
fn from(value: crate::get::fsm::AtBlobHeaderNextError) -> Self {
143+
use crate::get::fsm::AtBlobHeaderNextError::*;
144144
match value {
145145
e @ NotFound => {
146146
// > This indicates that the provider does not have the requested data.
@@ -156,9 +156,9 @@ impl From<crate::fetch::fsm::AtBlobHeaderNextError> for Error {
156156
}
157157
}
158158

159-
impl From<crate::fetch::fsm::DecodeError> for Error {
160-
fn from(value: crate::fetch::fsm::DecodeError) -> Self {
161-
use crate::fetch::fsm::DecodeError::*;
159+
impl From<crate::get::fsm::DecodeError> for Error {
160+
fn from(value: crate::get::fsm::DecodeError) -> Self {
161+
use crate::get::fsm::DecodeError::*;
162162

163163
match value {
164164
e @ NotFound => Error::NotFound(e.into()),

0 commit comments

Comments
 (0)