pub struct RustPackage { /* private fields */ }Expand description
A Cargo package whose manifest lies beneath the project root.
Workspace members and eligible in-root path dependencies both appear here;
is_workspace_member separates them.
Implementations§
Source§impl RustPackage
impl RustPackage
Sourcepub fn version(&self) -> &CargoPackageVersion
pub fn version(&self) -> &CargoPackageVersion
The validated direct or workspace-inherited version.
Sourcepub fn rust_version(&self) -> Option<&str>
pub fn rust_version(&self) -> Option<&str>
The declared or inherited rust-version, when the package states one.
Sourcepub fn edition(&self) -> CargoEdition
pub fn edition(&self) -> CargoEdition
The direct, inherited, or Cargo-defaulted Rust edition.
Sourcepub fn manifest_path(&self) -> &str
pub fn manifest_path(&self) -> &str
The repository-relative, /-separated manifest path.
Sourcepub fn relative_directory(&self) -> &str
pub fn relative_directory(&self) -> &str
The repository-relative package directory; empty for the root package.
Sourcepub fn directory_in(&self, root: &Path) -> PathBuf
pub fn directory_in(&self, root: &Path) -> PathBuf
This package’s directory beneath a caller-supplied spelling of the root.
Project loading canonicalizes its root, so a consumer that keys caches
or reports paths by the root it passed in re-bases through this rather
than through Self::directory.
Sourcepub fn is_workspace_member(&self) -> bool
pub fn is_workspace_member(&self) -> bool
Whether the workspace declares this package as a member.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RustPackage
impl RefUnwindSafe for RustPackage
impl Send for RustPackage
impl Sync for RustPackage
impl Unpin for RustPackage
impl UnsafeUnpin for RustPackage
impl UnwindSafe for RustPackage
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, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for 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