Expand description
Source URL generation and sha256 computation.
Structs§
- Extracted
Source - An extracted crate source tree in a temporary directory.
- GitHub
Repo - Parsed GitHub repository info.
- Resolved
GitHub Source - Resolved GitHub source info.
Functions§
- compute_
sha256 - Download a URL and compute its sha256 hex digest.
- crates_
io_ url - Construct a crates.io download URL.
- extract_
tar_ gz - Extract a gzipped tarball (bytes) into a new temp directory and return the path to the single top-level directory inside it (the “crate root”).
- fetch_
and_ extract - Download a tarball, compute its sha256, and extract it to a temp directory. Returns the hash and the extracted source tree.
- fetch_
github_ raw - Fetch a raw file from a GitHub repo at a given tag.
- fetch_
github_ tree - Fetch the file listing of a GitHub repo at a given tag using the Trees API. Returns a list of file paths relative to the repo root.
- github_
archive_ url - Construct a GitHub archive URL for a given tag/version with a tag prefix.
- is_
prerelease_ tag - Returns true if the tag looks like a pre-release version. Detects common pre-release suffixes: -alpha, -beta, -rc, -dev, -pre.
- is_
valid_ sha256 - Returns true if the given string looks like a valid SHA256 hex digest.
- latest_
github_ release - Fetch the latest release tag from a GitHub repo. Tries both the releases API and tags API, then picks the best version-like tag. Skips non-version tags like “latest”, “nightly”, etc. Returns the tag name (e.g., “v1.2.3” or “1.2.3”).
- looks_
like_ version_ tag - Returns true if the given string looks like a version tag.
Matches patterns like
v1.2.3,1.2.3,v.1.2.3,tool-v1.2.3, etc. Returns false for tags likelatest,nightly,stable. - resolve_
github_ source - Try to resolve the correct GitHub archive URL and compute its SHA256.
When
tag_overrideis provided, it is used directly without tag prefix detection. Otherwise, triesv-prefixed tag first, then bare version. Whenuse_refs_tagsis true, the URL template uses/archive/refs/tags/instead of/archive/. - tag_
to_ jinja_ template - Replace the version portion of a tag with the jinja
{{ version }}placeholder. If the tag does not contain the version, returns the literal tag. - tag_
to_ version - Strip a version prefix (
vorv.) from a tag to get a bare version string. Handlesv1.2.3,v.1.2.3, and bare1.2.3patterns.