pub enum Source {
Local {
path: PathBuf,
},
GitHub {
owner: String,
repo: String,
path: PathBuf,
rev: Option<String>,
},
GitLab {
owner: String,
repo: String,
path: PathBuf,
rev: Option<String>,
},
Codeberg {
owner: String,
repo: String,
path: PathBuf,
rev: Option<String>,
},
HttpDirect {
url: String,
blake3: Option<String>,
},
}Expand description
Typed source — every variant carries everything needed to fetch.
Variants§
Local
Local file path (./foo.tlisp or absolute).
GitHub
github:owner/repo/path?ref=<tag-or-commit>
GitLab
gitlab:owner/repo/path?ref=<...>
Codeberg
codeberg:owner/repo/path?ref=<...>
HttpDirect
https://... or http://... — optionally pinned via #blake3=<hex>.
Implementations§
Source§impl Source
impl Source
Sourcepub fn parse(input: &str) -> Result<Self, ResolveError>
pub fn parse(input: &str) -> Result<Self, ResolveError>
Parse a URL string into a typed Source.
Sourcepub fn cache_key(&self) -> String
pub fn cache_key(&self) -> String
Cache key — a stable string that identifies this exact resolution target. Two URLs that resolve to the same bytes share a cache key.
Sourcepub fn declared_blake3(&self) -> Option<&str>
pub fn declared_blake3(&self) -> Option<&str>
If the URL had a content-pin (#blake3=<hex>), return it.
Trait Implementations§
impl Eq for Source
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more