pub struct ProviderDef {
pub id: String,
pub tool: String,
pub url_template: String,
pub archive: String,
pub archive_map: BTreeMap<String, String>,
pub strip: u32,
pub bin: Vec<String>,
pub os_map: BTreeMap<String, String>,
pub arch_map: BTreeMap<String, String>,
}Expand description
A declarative provider definition (one tool).
Fields§
§id: StringProvider id, e.g. "official/node".
tool: StringThe tool this provider serves.
url_template: StringURL template with {version}/{os}/{arch}/{ext} placeholders.
archive: StringArchive kind: tar.gz / tgz / zip / raw.
archive_map: BTreeMap<String, String>Per-OS override of the archive kind, keyed by the canonical OS token
(linux/macos/windows). Some upstreams ship different formats per
OS (e.g. gh: linux tar.gz, macOS zip); an entry here overrides
ProviderDef::archive for that OS.
strip: u32Components to strip when materializing (recorded for the store layout).
bin: Vec<String>Executables to expose (paths relative to the laid-out tree).
os_map: BTreeMap<String, String>Map a canonical OS token to the upstream spelling (macos → darwin).
arch_map: BTreeMap<String, String>Map a canonical arch token to the upstream spelling (aarch64 → arm64).
Implementations§
Source§impl ProviderDef
impl ProviderDef
Sourcepub fn render_artifact(
&self,
version: &str,
platform: &Platform,
checksum: Checksum,
size: Option<u64>,
) -> Artifact
pub fn render_artifact( &self, version: &str, platform: &Platform, checksum: Checksum, size: Option<u64>, ) -> Artifact
Render the artifact for version on platform, attaching checksum.
size is optional metadata carried into the lock.
Sourcepub fn archive_for(&self, platform: &Platform) -> String
pub fn archive_for(&self, platform: &Platform) -> String
The archive kind for platform: the per-OS override when present
(keyed by the canonical OS token), else the default Self::archive.
Trait Implementations§
Source§impl Clone for ProviderDef
impl Clone for ProviderDef
Source§fn clone(&self) -> ProviderDef
fn clone(&self) -> ProviderDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProviderDef
impl Debug for ProviderDef
Source§impl<'de> Deserialize<'de> for ProviderDef
impl<'de> Deserialize<'de> for ProviderDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ProviderDef
impl PartialEq for ProviderDef
Source§fn eq(&self, other: &ProviderDef) -> bool
fn eq(&self, other: &ProviderDef) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ProviderDef
impl Serialize for ProviderDef
impl StructuralPartialEq for ProviderDef
Auto Trait Implementations§
impl Freeze for ProviderDef
impl RefUnwindSafe for ProviderDef
impl Send for ProviderDef
impl Sync for ProviderDef
impl Unpin for ProviderDef
impl UnsafeUnpin for ProviderDef
impl UnwindSafe for ProviderDef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more