#[non_exhaustive]pub struct Package {
pub name: String,
pub version: Version,
pub root: Option<PathBuf>,
pub auto_bins: bool,
pub auto_libs: bool,
pub auto_tests: bool,
pub auto_examples: bool,
pub auto_benches: bool,
}Available on crate feature
workspace only.Expand description
A single package.
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: StringThe name of the package.
version: VersionThe version of the package..
root: Option<PathBuf>The root of the package.
auto_bins: boolAutomatically detect binaries.
auto_libs: boolAutomatically detect libraries.
auto_tests: boolAutomatically detect tests.
auto_examples: boolAutomatically detect examples.
auto_benches: boolAutomatically detect benches.
Implementations§
Source§impl Package
impl Package
Sourcepub fn find_all(&self, filter: WorkspaceFilter<'_>) -> Result<Vec<Found>>
pub fn find_all(&self, filter: WorkspaceFilter<'_>) -> Result<Vec<Found>>
Find every single entrypoint available.
Sourcepub fn find_bins(&self, filter: WorkspaceFilter<'_>) -> Result<Vec<Found>>
pub fn find_bins(&self, filter: WorkspaceFilter<'_>) -> Result<Vec<Found>>
Find all binaries matching the given name in the package.
Sourcepub fn find_lib(&self, filter: WorkspaceFilter<'_>) -> Result<Option<Found>>
pub fn find_lib(&self, filter: WorkspaceFilter<'_>) -> Result<Option<Found>>
Find a library entry point matching the given name in the package, if one exists.
Sourcepub fn find_tests(&self, filter: WorkspaceFilter<'_>) -> Result<Vec<Found>>
pub fn find_tests(&self, filter: WorkspaceFilter<'_>) -> Result<Vec<Found>>
Find all tests associated with the given base name.
Sourcepub fn find_examples(&self, filter: WorkspaceFilter<'_>) -> Result<Vec<Found>>
pub fn find_examples(&self, filter: WorkspaceFilter<'_>) -> Result<Vec<Found>>
Find all examples matching the given name in the package.
Sourcepub fn find_benches(&self, filter: WorkspaceFilter<'_>) -> Result<Vec<Found>>
pub fn find_benches(&self, filter: WorkspaceFilter<'_>) -> Result<Vec<Found>>
Find all benches matching the given name in the workspace.
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 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
Mutably borrows from an owned value. Read more