uxn_tal/fetch/
provider.rs1use std::path::{Path, PathBuf};
2
3#[derive(Debug, Clone)]
4pub struct RepoRef {
5 pub host: String, pub owner: String, pub repo: String, pub branch: String, pub path: Option<String>, }
11
12#[derive(Debug)]
13pub struct FetchResult {
14 pub entry_local: PathBuf, pub all_files: Vec<PathBuf>,
16}
17
18pub trait Provider: Send + Sync {
19 fn parse_url(&self, url: &str) -> Option<RepoRef>;
20 fn fetch_tal_tree(
21 &self,
22 rf: &RepoRef,
23 out_root: &Path,
24 ) -> Result<FetchResult, Box<dyn std::error::Error>>;
25
26 fn parse_git_url(&self, _url: &str) -> Option<(RepoRef, String)> {
28 None }
30}