use std::future::Future;
use std::path::Path;
use aws_sdk_s3::primitives::ByteStream;
use chrono::DateTime;
use chrono::Utc;
use crate::Error;
pub mod fs;
pub mod s3;
#[cfg(test)]
pub mod mock_storage;
pub trait Storage {
fn exists(&self, path: impl AsRef<Path>) -> impl Future<Output = bool>;
fn copy(
&self,
from: impl AsRef<Path> + Send,
to: impl AsRef<Path> + Send,
) -> impl Future<Output = Result<u64, Error>> + Send;
fn create_dir_all(
&self,
path: impl AsRef<Path> + Send,
) -> impl Future<Output = Result<(), Error>> + Send;
fn remove_dir_all(
&self,
path: impl AsRef<Path> + Send,
) -> impl Future<Output = Result<(), Error>> + Send;
fn modified_timestamp(
&self,
path: impl AsRef<Path>,
) -> impl Future<Output = Result<DateTime<Utc>, Error>>;
fn remove_file(
&self,
path: impl AsRef<Path> + Send,
) -> impl Future<Output = Result<(), std::io::Error>> + Send;
fn write_file(
&self,
path: impl AsRef<Path> + Send + Sync,
bytes: &[u8],
) -> impl Future<Output = Result<(), Error>> + Send + Sync;
fn open_file(
&self,
path: impl AsRef<Path> + Send,
) -> impl Future<Output = Result<tokio::fs::File, Error>> + Send;
fn create_file(
&self,
path: impl AsRef<Path>,
) -> impl Future<Output = Result<tokio::fs::File, Error>>;
fn read_file(
&self,
path: impl AsRef<Path> + Send + Sync,
) -> impl Future<Output = Result<Vec<u8>, Error>> + Send + Sync;
fn read_byte_stream(
&self,
path: impl AsRef<Path> + Send + Sync,
) -> impl Future<Output = Result<ByteStream, Error>> + Send + Sync;
}