1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use {std::path::Path, uuid::Uuid};
pub use eyre;
pub trait Registry {
fn store(
&mut self,
source: &Path,
source_format: &str,
native_format: &str,
tags: &[&str],
) -> eyre::Result<Uuid>;
fn fetch(&mut self, asset: &Uuid) -> eyre::Result<Box<Path>>;
}
pub trait Importer: Send + Sync {
fn name(&self) -> &str;
fn source(&self) -> &str;
fn native(&self) -> &str;
fn import(
&self,
source_path: &Path,
native_path: &Path,
registry: &mut dyn Registry,
) -> eyre::Result<()>;
}