diff --git a/src/utils/chunks/mod.rs b/src/utils/chunks/mod.rs index 53da86b5f9..2eabcccb24 100644 --- a/src/utils/chunks/mod.rs +++ b/src/utils/chunks/mod.rs @@ -7,7 +7,7 @@ mod types; -pub use types::{Chunked, MissingObjectsInfo, Named}; +pub use types::{Assemblable, Chunked, MissingObjectsInfo}; use std::sync::Arc; use std::time::Duration; diff --git a/src/utils/chunks/types.rs b/src/utils/chunks/types.rs index 72c50e5a07..836305298a 100644 --- a/src/utils/chunks/types.rs +++ b/src/utils/chunks/types.rs @@ -12,8 +12,8 @@ use crate::utils::fs; /// objects and their missing chunks. pub type MissingObjectsInfo<'m, T> = (Vec<&'m Chunked>, Vec>); -/// A trait for objects that have a name. -pub trait Named { +/// A trait for objects that can be assembled via the `assemble_difs` endpoint. +pub trait Assemblable { /// Returns the name of the object. fn name(&self) -> &str; } @@ -87,9 +87,9 @@ where } } -impl Named for Chunked +impl Assemblable for Chunked where - T: Named, + T: Assemblable, { fn name(&self) -> &str { self.object().name() diff --git a/src/utils/dif_upload.rs b/src/utils/dif_upload.rs index afc6a41914..7ac37063c2 100644 --- a/src/utils/dif_upload.rs +++ b/src/utils/dif_upload.rs @@ -38,7 +38,7 @@ use crate::api::{ use crate::config::Config; use crate::constants::{DEFAULT_MAX_DIF_SIZE, DEFAULT_MAX_WAIT}; use crate::utils::chunks::{ - upload_chunks, BatchedSliceExt, Chunk, Chunked, ItemSize, MissingObjectsInfo, Named, + upload_chunks, Assemblable, BatchedSliceExt, Chunk, Chunked, ItemSize, MissingObjectsInfo, ASSEMBLE_POLL_INTERVAL, }; use crate::utils::dif::ObjectDifFeatures; @@ -304,7 +304,7 @@ impl Display for DifMatch<'_> { } } -impl Named for DifMatch<'_> { +impl Assemblable for DifMatch<'_> { /// A DIF's name is its file name. fn name(&self) -> &str { self.file_name() @@ -1404,7 +1404,7 @@ fn poll_assemble( options: &DifUpload, ) -> Result<(Vec, bool)> where - T: Display + Named, + T: Display + Assemblable, Chunked: IntoAssembleRequest, { let progress_style = ProgressStyle::default_bar().template(