feat(rust): add generic async_try_clone implementation for structs with clone
@@ -91,4 +91,14 @@ pub mod traits {
/// Try cloning a object and return an `Err` in case of failure.
async fn async_try_clone(&self) -> Result<Self>;
}
+
+ #[async_trait]
+ impl<D> AsyncTryClone for D
+ where
+ D: Clone + Sync,
+ {
+ async fn async_try_clone(&self) -> Result<Self> {
+ Ok(self.clone())
+ }
+ }
}
