Documentation
¶
Overview ¶
Package rust resolves Rust toolchain versions from the official static.rust-lang.org manifest index. The index is a single, anonymous, chronological text listing of every channel manifest ever published; the version-named manifests in it (channel-rust-1.97.0.toml) enumerate the releases, each dated by the directory it was published under, so the provider fetches the index once and lets the framework own selection.
The channel key picks the release channel to track: stable (the default) or beta, whose dated snapshots are numbered (1.98.0-beta.1). Nightly builds are dated snapshots without a version of their own, so they cannot be tracked.
Index ¶
- type Option
- type Provider
- func (p *Provider) Dated()
- func (p *Provider) Describe(r provider.Resource) string
- func (p *Provider) Discover(ctx context.Context, r provider.Resource) ([]model.Candidate, error)
- func (p *Provider) Keys() []provider.Key
- func (p *Provider) Name() string
- func (p *Provider) Resource(d directive.Directive) (provider.Resource, error)
- func (p *Provider) URL(r provider.Resource, c model.Candidate) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Provider)
Option configures a Provider.
func WithTransport ¶
func WithTransport(rt http.RoundTripper) Option
WithTransport overrides the HTTP transport, for tests.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider resolves Rust toolchain versions from static.rust-lang.org's public, unauthenticated manifest index. The index is a single chronological text listing of every channel manifest, so the provider fetches it once and lets the framework own selection; it lists candidates and tags each with the date of the directory its manifest was published under, which cooldown consumes.
func New ¶
New returns the Rust provider. The manifest index is public and publishes no rate-limit headers, so the client is a plain cached one with no ratelimit wrapper or credentials.
func (*Provider) Dated ¶
func (p *Provider) Dated()
Dated marks the listing as date-bearing: every release carries the date its manifest was published under, so cooldown applies.
func (*Provider) Describe ¶
Describe returns a human-readable label for a resource, noting when it is scoped to the beta channel.
func (*Provider) Discover ¶
Discover lists candidate Rust versions for the resource's channel, reading the manifest index in one fetch. The index holds the whole release history in a single response, so there is no pagination and nothing is ever left unread - --deep has no work to do here. A version re-published under a later directory (a fixed-up manifest) keeps its first date: that is when the release shipped, which is what cooldown measures.
func (*Provider) Resource ¶
Resource validates a directive into a Rust resource: which release channel's versions to list, stable when omitted. Nightly is called out separately - it is a real channel a user may plausibly ask for, but its builds are dated snapshots with no version of their own, so it cannot be tracked.
func (*Provider) URL ¶
URL builds the release-notes page for a resolved candidate: the version's tag page on the rust-lang/rust repository. Rust versions are bare, so Ref and Version agree and the synthesized current-version candidate links too. Only stable releases are tagged there - a beta snapshot has no tag, so a beta-channel resource is never linked.