Struct axoproject::WorkspaceInfo

source ·
pub struct WorkspaceInfo {
    pub kind: WorkspaceKind,
    pub target_dir: Utf8PathBuf,
    pub workspace_dir: Utf8PathBuf,
    pub package_info: Vec<PackageInfo>,
    pub manifest_path: Utf8PathBuf,
    pub root_auto_includes: AutoIncludes,
    pub warnings: Vec<AxoprojectError>,
    pub cargo_metadata_table: Option<Value>,
    pub cargo_profiles: CargoProfiles,
}
Expand description

Info on the current workspace

This can either be a cargo workspace or an npm workspace, the concepts are conflated to let users of axoproject handle things more uniformly.

Fields§

§kind: WorkspaceKind

The kinf of workspace this is (Rust or Javascript)

§target_dir: Utf8PathBuf

The directory where build output will go (generally target/)

§workspace_dir: Utf8PathBuf

The root directory of the workspace (where the root Cargo.toml is)

§package_info: Vec<PackageInfo>

Computed info about the packages.

This notably includes finding readmes and licenses even if the user didn’t specify their location – something Cargo does but Guppy (and cargo-metadata) don’t.

§manifest_path: Utf8PathBuf

Path to the root manifest of the workspace

This can be either a Cargo.toml or package.json. In either case this manifest may or may not represent a “real” package. Both systems have some notion of “virtual” manifest which exists only to list the actual packages in the workspace.

§root_auto_includes: AutoIncludes

If the workspace root has some auto-includeable files, here they are!

This is currently what is use for top-level Announcement contents.

§warnings: Vec<AxoprojectError>

Non-fatal issues that were encountered and should probably be reported

§cargo_metadata_table: Option<Value>

Raw cargo [workspace.metadata] table

§cargo_profiles: CargoProfiles

Any [profile.*] entries we found in the root Cargo.toml

Implementations§

source§

impl WorkspaceInfo

source

pub fn changelog_for_version( &self, version: &Version, ) -> Result<Option<ChangelogInfo>>

Get the changelog for a given version from the root workspace’s changelog

source§

impl WorkspaceInfo

source

pub fn package(&self, idx: PackageIdx) -> &PackageInfo

Get a package

source

pub fn package_mut(&mut self, idx: PackageIdx) -> &mut PackageInfo

Get a mutable package

source

pub fn packages(&self) -> impl Iterator<Item = (PackageIdx, &PackageInfo)>

Iterate over packages

source

pub fn github_repo( &self, packages: Option<&[PackageIdx]>, ) -> Result<Option<GithubRepo>>

Returns a struct which contains the repository’s owner and name.

source

pub fn web_url(&self, packages: Option<&[PackageIdx]>) -> Result<Option<String>>

Returns a web version of the repository URL, converted from SSH if necessary, with .git suffix trimmed.

source

pub fn repository_url( &self, packages: Option<&[PackageIdx]>, ) -> Result<Option<String>>

Returns a consensus package URL for the given packages, if any exists

Auto Trait Implementations§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more