Skip to content

Commit

Permalink
Add Send trait to as_any() store calls
Browse files Browse the repository at this point in the history
This will be used in future PR that need to pass this across threads.
  • Loading branch information
allada committed Jun 17, 2022
1 parent f2b825b commit c4be423
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cas/store/compression_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ impl StoreTrait for CompressionStore {
Ok(())
}

fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any> {
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any + Send> {
Box::new(self)
}
}
2 changes: 1 addition & 1 deletion cas/store/dedup_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ impl StoreTrait for DedupStore {
Ok(())
}

fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any> {
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any + Send> {
Box::new(self)
}
}
2 changes: 1 addition & 1 deletion cas/store/fast_slow_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl StoreTrait for FastSlowStore {
Ok(())
}

fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any> {
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any + Send> {
Box::new(self)
}
}
2 changes: 1 addition & 1 deletion cas/store/filesystem_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ impl StoreTrait for FilesystemStore {
Ok(())
}

fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any> {
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any + Send> {
Box::new(self)
}
}
2 changes: 1 addition & 1 deletion cas/store/memory_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl StoreTrait for MemoryStore {
Ok(())
}

fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any> {
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any + Send> {
Box::new(self)
}
}
2 changes: 1 addition & 1 deletion cas/store/ref_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl StoreTrait for RefStore {
Pin::new(store.as_ref()).get_part(digest, writer, offset, length).await
}

fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any> {
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any + Send> {
Box::new(self)
}
}
2 changes: 1 addition & 1 deletion cas/store/s3_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ impl StoreTrait for S3Store {
.await
}

fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any> {
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any + Send> {
Box::new(self)
}
}
2 changes: 1 addition & 1 deletion cas/store/size_partitioning_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl StoreTrait for SizePartitioningStore {
.await
}

fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any> {
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any + Send> {
Box::new(self)
}
}
2 changes: 1 addition & 1 deletion cas/store/store_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ pub trait StoreTrait: Sync + Send + Unpin {
}

/// Expect the returned Any to be `Arc<Self>`.
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any>;
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any + Send>;
}
2 changes: 1 addition & 1 deletion cas/store/verify_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl StoreTrait for VerifyStore {
self.pin_inner().get_part(digest, writer, offset, length).await
}

fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any> {
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any + Send> {
Box::new(self)
}
}

0 comments on commit c4be423

Please sign in to comment.