diff --git a/fusio/src/dynamic/fs.rs b/fusio/src/dynamic/fs.rs index 1df009f..c5100c8 100644 --- a/fusio/src/dynamic/fs.rs +++ b/fusio/src/dynamic/fs.rs @@ -84,6 +84,19 @@ pub trait DynFs: MaybeSend + MaybeSync { &'s self, path: &'path Path, ) -> Pin> + 's>>; + + fn copy<'s, 'path: 's>( + &'s self, + from: &'path Path, + to: &'path Path, + ) -> Pin> + 's>>; + + fn link<'s, 'path: 's>( + &'s self, + from: &'path Path, + to_fs: &'s Self, + to: &'path Path, + ) -> Pin> + 's>>; } impl DynFs for F { @@ -130,6 +143,27 @@ impl DynFs for F { ) -> Pin> + 's>> { Box::pin(F::remove(self, path)) } + + fn copy<'s, 'path: 's>( + &'s self, + from: &'path Path, + to: &'path Path, + ) -> Pin> + 's>> { + Box::pin(F::copy(self, from, to)) + } + + fn link<'s, 'path: 's>( + &'s self, + from: &'path Path, + to_fs: &'s Self, + to: &'path Path, + ) -> Pin> + 's>> { + Box::pin(async move { + self.link(from, to_fs, to).await?; + + Ok(()) + }) + } } #[cfg(test)] diff --git a/fusio/src/fs/mod.rs b/fusio/src/fs/mod.rs index 74bfcbe..db42ff9 100644 --- a/fusio/src/fs/mod.rs +++ b/fusio/src/fs/mod.rs @@ -8,7 +8,7 @@ use std::{cmp, future::Future}; use futures_core::Stream; pub use options::*; -use crate::{path::Path, Error, IoBufMut, MaybeSend, MaybeSync, Read, Write}; +use crate::{path::Path, Error, MaybeSend, MaybeSync, Read, Write}; #[derive(Debug)] pub struct FileMeta { diff --git a/fusio/src/impls/remotes/aws/fs.rs b/fusio/src/impls/remotes/aws/fs.rs index 1324948..570f05e 100644 --- a/fusio/src/impls/remotes/aws/fs.rs +++ b/fusio/src/impls/remotes/aws/fs.rs @@ -20,7 +20,7 @@ use crate::{ }, http::{DynHttpClient, HttpClient, HttpError}, }, - Error, Read, + Error, }; pub struct AmazonS3Builder { @@ -349,7 +349,7 @@ mod tests { options::S3Options, s3::S3File, }, - http::{tokio::TokioClient, DynHttpClient, HttpClient}, + http::{tokio::TokioClient, DynHttpClient}, }, Read, Write, }; diff --git a/fusio/src/impls/remotes/aws/s3.rs b/fusio/src/impls/remotes/aws/s3.rs index 6933f4e..92c548b 100644 --- a/fusio/src/impls/remotes/aws/s3.rs +++ b/fusio/src/impls/remotes/aws/s3.rs @@ -268,7 +268,7 @@ mod tests { options::S3Options, s3::S3File, }, - http::{tokio::TokioClient, DynHttpClient, HttpClient}, + http::{tokio::TokioClient, DynHttpClient}, }, Read, Write, }; diff --git a/fusio/src/impls/remotes/aws/writer.rs b/fusio/src/impls/remotes/aws/writer.rs index 9d12dc0..6b96d5b 100644 --- a/fusio/src/impls/remotes/aws/writer.rs +++ b/fusio/src/impls/remotes/aws/writer.rs @@ -2,7 +2,7 @@ use std::{mem, pin::Pin, sync::Arc}; use bytes::{BufMut, BytesMut}; use futures_util::{stream::FuturesOrdered, StreamExt}; -use http_body_util::{Empty, Full}; +use http_body_util::Full; use crate::{ dynamic::MaybeSendFuture,