pub struct Package { /* private fields */ }Expand description
The representation of an individual package in a Miden project
Implementations§
Source§impl Package
Constructor
impl Package
Constructor
Sourcepub fn new(name: impl Into<PackageId>, default_target: Target) -> Box<Self>
pub fn new(name: impl Into<PackageId>, default_target: Target) -> Box<Self>
Create a new Package named name with the given default target.
The resulting package will have a default version of 0.0.0, no dependencies, and an
initial set of profiles that consist of the default development and release profiles. The
project will have no other configuration set up - that must be done in subsequent steps.
Sourcepub fn with_version(self: Box<Self>, version: SemVer) -> Box<Self>
pub fn with_version(self: Box<Self>, version: SemVer) -> Box<Self>
Specify a version for this package during initial construction
Sourcepub fn with_lints(self: Box<Self>, lints: MetadataSet) -> Box<Self>
pub fn with_lints(self: Box<Self>, lints: MetadataSet) -> Box<Self>
Provide the lint configuration for this package during initial construction
Sourcepub fn with_metadata(self: Box<Self>, metadata: MetadataSet) -> Box<Self>
pub fn with_metadata(self: Box<Self>, metadata: MetadataSet) -> Box<Self>
Provide the metadata for this package during initial construction
Sourcepub fn with_targets(
self: Box<Self>,
targets: impl IntoIterator<Item = Target>,
) -> Box<Self>
pub fn with_targets( self: Box<Self>, targets: impl IntoIterator<Item = Target>, ) -> Box<Self>
Add targets to this package during initial construction
This function will panic if any of the given targets conflict with existing targets or each other.
Sourcepub fn with_profile(self: Box<Self>, profile: Profile) -> Box<Self>
pub fn with_profile(self: Box<Self>, profile: Profile) -> Box<Self>
Add a profile to this package during initial construction
If the given profile matches an existing profile, it will be merged over the top of it.
Sourcepub fn with_dependencies(
self: Box<Self>,
dependencies: impl IntoIterator<Item = Dependency>,
) -> Box<Self>
pub fn with_dependencies( self: Box<Self>, dependencies: impl IntoIterator<Item = Dependency>, ) -> Box<Self>
Add dependencies to this package during initial construction
This function will panic if any of the given dependencies conflict with existing deps or each other.
Source§impl Package
Accessors
impl Package
Accessors
Sourcepub fn description(&self) -> Option<Arc<str>>
pub fn description(&self) -> Option<Arc<str>>
Get the description of this package, if specified
Sourcepub fn set_description(&mut self, description: impl Into<Arc<str>>)
pub fn set_description(&mut self, description: impl Into<Arc<str>>)
Set the description of this package, if specified
Sourcepub fn dependencies(&self) -> &[Dependency]
pub fn dependencies(&self) -> &[Dependency]
Get the set of dependencies this package requires
Sourcepub fn num_dependencies(&self) -> usize
pub fn num_dependencies(&self) -> usize
Get the number of dependencies this package requires
Sourcepub fn lints(&self) -> &MetadataSet
pub fn lints(&self) -> &MetadataSet
Get a reference to the linter metadata configured for this package
Sourcepub fn metadata(&self) -> &MetadataSet
pub fn metadata(&self) -> &MetadataSet
Get a reference to the custom metadata configured for this package
Sourcepub fn profiles(&self) -> &[Profile]
pub fn profiles(&self) -> &[Profile]
Get a reference to the build profiles configured for this package
Sourcepub fn get_profile(&self, name: &str) -> Option<&Profile>
pub fn get_profile(&self, name: &str) -> Option<&Profile>
Returns a profile with the specified name, or None if such a profile does not exist in this package.
Sourcepub fn library_target(&self) -> Option<&Span<Target>>
pub fn library_target(&self) -> Option<&Span<Target>>
Get a reference to the library build target provided by this package
Sourcepub fn executable_targets(&self) -> &[Span<Target>]
pub fn executable_targets(&self) -> &[Span<Target>]
Get a reference to the executable build targets provided by this package
Sourcepub fn manifest_path(&self) -> Option<&Path>
pub fn manifest_path(&self) -> Option<&Path>
Get the location of the manifest this package was loaded from, if known/applicable.
Source§impl Package
Parsing
impl Package
Parsing
Sourcepub fn load(source: Arc<SourceFile>) -> Result<Box<Self>, Report>
pub fn load(source: Arc<SourceFile>) -> Result<Box<Self>, Report>
Load a package from source, expected to be a standalone package-level miden-project.toml
manifest.
Sourcepub fn load_from_workspace(
source: Arc<SourceFile>,
workspace: &WorkspaceFile,
) -> Result<Box<Self>, Report>
pub fn load_from_workspace( source: Arc<SourceFile>, workspace: &WorkspaceFile, ) -> Result<Box<Self>, Report>
Load a package from source, expected to be a package-level miden-project.toml manifest
which is presumed to be a member of workspace for purposes of configuration inheritance.
Source§impl Package
impl Package
Sourcepub fn to_toml(&self) -> Result<String, Report>
pub fn to_toml(&self) -> Result<String, Report>
Pretty print this Package in TOML format.
The output of this function is not guaranteed to be identical to the way the original manifest (if one exists) was written, i.e. it may emit keys that are optional or that contain default or inherited values.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnsafeUnpin for Package
impl UnwindSafe for Package
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 moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more