#[non_exhaustive]pub struct PackageSpec {Show 18 fields
pub name: String,
pub path: PathBuf,
pub driver: Option<String>,
pub publisher: Option<String>,
pub noun: Option<String>,
pub publish: Option<Publish>,
pub registry: Option<String>,
pub query: Option<Vec<String>>,
pub changelog: Option<PathBuf>,
pub first_minor: bool,
pub prerelease: Option<Prerelease>,
pub marker: bool,
pub owners: Option<Vec<String>>,
pub trusted_publishing_only: Option<bool>,
pub ecosystem: Option<String>,
pub lockfile: Option<String>,
pub at: AttachPoints,
pub spec: DriverSpec,
/* private fields */
}Expand description
One released package: its manifest, how that manifest contains the version, and how it is published.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe name fragments, tags, and the changelog use for the package.
path: PathBufThe manifest, relative to the directory containing .ctl/.
driver: Option<String>A drivers entry or stock driver name. Omit to infer it from the
manifest file name.
publisher: Option<String>Stock cargo / bun, a publishers key, or omit to infer. none
releases the package on GitHub only: tag, Release, and assets, with no
registry upload.
noun: Option<String>Pretty noun (crate, package, wheel). Defaults from the publisher.
publish: Option<Publish>How the package is published, beyond what its manifest implies.
A mapping contains options of the publisher the package resolves to,
which keeps its upload command and its registry check: verify: false
for cargo. A list replaces the whole upload command, and the registry
check goes with it unless query is set. When omitted, the publisher
runs with its defaults.
registry: Option<String>Fills the publisher’s {registry} placeholder and is named in the plan.
Empty means none.
query: Option<Vec<String>>Asks the registry whether a version is published, in place of the publisher’s query or the crates.io index read. When omitted, the publisher decides; an empty list turns the check off for this package.
changelog: Option<PathBuf>Package CHANGELOG.md. Defaults to next to the manifest.
first_minor: boolLets this package leave 0.0.0 with a minor fragment, so its first
release is 0.1.0. When omitted, a package at 0.0.0 takes only
patch and first releases 0.0.1. Inert once the package has released.
prerelease: Option<Prerelease>The tag of the candidate versions this package releases, such as rc:
verctl version writes <base>-<tag>.<count> while it is set. When
omitted, the package releases stable versions, and a current prerelease
version becomes the stable one.
marker: boolThe version is on one marker line of the file, such as
# version: 1.2.0, // version: 1.2.0, or <!-- version: 1.2.0 -->.
So a file of any type can be a package, such as one reusable workflow
or one script.
When unset, a file is read by its stock or named driver, and a stray
marker line in it means nothing. It takes no driver or driver fields,
and with no publisher the package releases on GitHub only.
owners: Option<Vec<String>>The crates.io logins this package’s crates must list as owners, which
check registry proves. It replaces the top-level owners for this
package. When omitted, the package expects the top-level list.
trusted_publishing_only: Option<bool>Whether this package’s crates on crates.io must disable API-token
publishing (trustpub_only = true). Overrides the top-level setting
when set; omit to inherit it.
ecosystem: Option<String>Named ecosystem (cargo, bun, or an entry under ecosystems). Omit
to infer the built-in ecosystem from the manifest file name.
lockfile: Option<String>Named step under steps that replaces this package’s Lockfile block.
Omit to use the ecosystem’s built-in or declared lockfile block.
at: AttachPointsPackage-scoped lifecycle points (version, verify, released) where
named steps attach. Omit to run no per-package steps.
spec: DriverSpecInline driver fields. They override the named driver’s.
Implementations§
Source§impl PackageSpec
impl PackageSpec
Sourcepub fn publish_command(&self) -> Option<&[String]>
pub fn publish_command(&self) -> Option<&[String]>
The upload command this package wrote in place of its publisher’s.
Sourcepub fn publish_options(&self) -> Option<&PublishOptions>
pub fn publish_options(&self) -> Option<&PublishOptions>
The options this package wrote for its publisher.
Sourcepub fn publish_step(&self) -> Option<&str>
pub fn publish_step(&self) -> Option<&str>
The named step under steps that replaces this package’s upload
command while keeping its ecosystem’s registry query.
Sourcepub fn lockfile_step<'a>(&'a self, config: &'a Config) -> Option<&'a str>
pub fn lockfile_step<'a>(&'a self, config: &'a Config) -> Option<&'a str>
The named step implementing this package’s Lockfile block, whether set directly on the package or inherited from its declared ecosystem.
Sourcepub fn effective_publish_step<'a>(
&'a self,
config: &'a Config,
) -> Option<&'a str>
pub fn effective_publish_step<'a>( &'a self, config: &'a Config, ) -> Option<&'a str>
The named step implementing this package’s publish upload block,
whether set directly via publish: <step> or inherited from its
declared ecosystem when no explicit publisher overrides it.
Sourcepub fn changelog_path(&self, root: &Path) -> PathBuf
pub fn changelog_path(&self, root: &Path) -> PathBuf
The package changelog, resolved against root.
Sourcepub fn resolve(&self, config: &Config, root: &Path) -> Result<Driver>
pub fn resolve(&self, config: &Config, root: &Path) -> Result<Driver>
The version driver. It is the stock or named driver with this package’s own fields over it. A lockfile follow-up is inferred when none is set.
§Errors
Returns an error when the merged driver is incomplete or invalid, as
described for DriverSpec::into_driver. A package whose file is
not Cargo.toml, package.json, pyproject.toml, go.mod, or
VERSION needs a driver of its own.
Sourcepub fn current(&self, config: &Config, root: &Path) -> Result<Current>
pub fn current(&self, config: &Config, root: &Path) -> Result<Current>
The version this package’s file contains now, read through its driver. Every command that reads a current version reads it here, so each error shows the package and its file.
§Errors
Returns an error naming the package when its driver cannot be resolved, its file cannot be read, or the driver finds no version in it.