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: WorkspaceKindThe kinf of workspace this is (Rust or Javascript)
target_dir: Utf8PathBufThe directory where build output will go (generally target/)
workspace_dir: Utf8PathBufThe 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: Utf8PathBufPath 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: AutoIncludesIf 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: CargoProfilesAny [profile.*] entries we found in the root Cargo.toml
Implementations§
source§impl WorkspaceInfo
impl WorkspaceInfo
sourcepub fn changelog_for_version(
&self,
version: &Version,
) -> Result<Option<ChangelogInfo>>
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
impl WorkspaceInfo
sourcepub fn package(&self, idx: PackageIdx) -> &PackageInfo
pub fn package(&self, idx: PackageIdx) -> &PackageInfo
Get a package
sourcepub fn package_mut(&mut self, idx: PackageIdx) -> &mut PackageInfo
pub fn package_mut(&mut self, idx: PackageIdx) -> &mut PackageInfo
Get a mutable package
sourcepub fn packages(&self) -> impl Iterator<Item = (PackageIdx, &PackageInfo)>
pub fn packages(&self) -> impl Iterator<Item = (PackageIdx, &PackageInfo)>
Iterate over packages
sourcepub fn github_repo(
&self,
packages: Option<&[PackageIdx]>,
) -> Result<Option<GithubRepo>>
pub fn github_repo( &self, packages: Option<&[PackageIdx]>, ) -> Result<Option<GithubRepo>>
Returns a struct which contains the repository’s owner and name.
sourcepub fn web_url(&self, packages: Option<&[PackageIdx]>) -> Result<Option<String>>
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.
sourcepub fn repository_url(
&self,
packages: Option<&[PackageIdx]>,
) -> Result<Option<String>>
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§
impl Freeze for WorkspaceInfo
impl !RefUnwindSafe for WorkspaceInfo
impl Send for WorkspaceInfo
impl Sync for WorkspaceInfo
impl Unpin for WorkspaceInfo
impl !UnwindSafe for WorkspaceInfo
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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