aboutsummaryrefslogtreecommitdiffstats
path: root/filamento/src/files.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--filamento/src/files.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/filamento/src/files.rs b/filamento/src/files.rs
new file mode 100644
index 0000000..0dfe347
--- /dev/null
+++ b/filamento/src/files.rs
@@ -0,0 +1,19 @@
+use std::error::Error;
+
+pub trait FileStore {
+ type Err: Clone + Send + Error;
+
+ fn is_stored(
+ &self,
+ name: &str,
+ ) -> impl std::future::Future<Output = Result<bool, Self::Err>> + std::marker::Send;
+ fn store(
+ &self,
+ name: &str,
+ data: &[u8],
+ ) -> impl std::future::Future<Output = Result<(), Self::Err>> + std::marker::Send;
+ fn delete(
+ &self,
+ name: &str,
+ ) -> impl std::future::Future<Output = Result<(), Self::Err>> + std::marker::Send;
+}