Skip to main content

PackageSpec

Struct PackageSpec 

Source
#[non_exhaustive]
pub struct PackageSpec {
Show 14 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 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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

The name fragments, tags, and the changelog use for the package.

§path: PathBuf

The 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: bool

Lets 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: bool

The 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.

§spec: DriverSpec

Inline driver fields. They override the named driver’s.

Implementations§

Source§

impl PackageSpec

Source

pub fn publish_command(&self) -> Option<&[String]>

The upload command this package wrote in place of its publisher’s.

Source

pub fn publish_options(&self) -> Option<&PublishOptions>

The options this package wrote for its publisher.

Source

pub fn changelog_path(&self, root: &Path) -> PathBuf

The package changelog, resolved against root.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for PackageSpec

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PackageSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PackageSpec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

§

impl Forget for PackageSpec

§

impl Freeze for PackageSpec
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const LeafNode<String, Value> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Value)>>: Freeze, PhantomData<String>: Freeze, *const LeafNode<String, IgnoredAny> is !null: Freeze, PhantomData<Box<(String, IgnoredAny)>>: Freeze,

§

impl Move for PackageSpec

§

impl RefUnwindSafe for PackageSpec

§

impl Send for PackageSpec
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send, NodeRef<Owned, String, IgnoredAny, LeafOrInternal>: Send, BoxRaw<(String, IgnoredAny)>: Send,

§

impl Sync for PackageSpec
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync, NodeRef<Owned, String, IgnoredAny, LeafOrInternal>: Sync, BoxRaw<(String, IgnoredAny)>: Sync,

§

impl Unpin for PackageSpec
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin, *const LeafNode<String, IgnoredAny> is !null: Unpin, Box<(String, IgnoredAny)>: Unpin,

§

impl UnsafeUnpin for PackageSpec

§

impl UnwindSafe for PackageSpec

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.