pub struct Package {
inner: Rc<PackageInner>,
}
Expand description
Information about a package that is available somewhere in the file system.
A package is a Cargo.toml
file plus all the files that are part of it.
Fields§
§inner: Rc<PackageInner>
Implementations§
source§impl Package
impl Package
sourcepub fn new(manifest: Manifest, manifest_path: &Path) -> Package
pub fn new(manifest: Manifest, manifest_path: &Path) -> Package
Creates a package from a manifest and its location.
sourcepub fn dependencies(&self) -> &[Dependency]
pub fn dependencies(&self) -> &[Dependency]
Gets the manifest dependencies.
sourcepub fn manifest_mut(&mut self) -> &mut Manifest
pub fn manifest_mut(&mut self) -> &mut Manifest
Gets the manifest.
sourcepub fn manifest_path(&self) -> &Path
pub fn manifest_path(&self) -> &Path
Gets the path to the manifest.
sourcepub fn name(&self) -> InternedString
pub fn name(&self) -> InternedString
Gets the name of the package.
sourcepub fn package_id(&self) -> PackageId
pub fn package_id(&self) -> PackageId
Gets the PackageId
object for the package (fully defines a package).
sourcepub fn library(&self) -> Option<&Target>
pub fn library(&self) -> Option<&Target>
Gets the library crate for this package, if it exists.
Gets the package authors.
sourcepub fn publish(&self) -> &Option<Vec<String>>
pub fn publish(&self) -> &Option<Vec<String>>
Returns None
if the package is set to publish.
Returns Some(allowed_registries)
if publishing is limited to specified
registries or if package is set to not publish.
sourcepub fn proc_macro(&self) -> bool
pub fn proc_macro(&self) -> bool
Returns true
if this package is a proc-macro.
sourcepub fn rust_version(&self) -> Option<&RustVersion>
pub fn rust_version(&self) -> Option<&RustVersion>
Gets the package’s minimum Rust version.
sourcepub fn has_custom_build(&self) -> bool
pub fn has_custom_build(&self) -> bool
Returns true
if the package uses a custom build script for any target.
pub fn map_source(self, to_replace: SourceId, replace_with: SourceId) -> Package
sourcepub fn include_lockfile(&self) -> bool
pub fn include_lockfile(&self) -> bool
Returns if package should include Cargo.lock
.
pub fn serialized( &self, unstable_flags: &CliUnstable, cargo_features: &Features, ) -> SerializedPackage
Trait Implementations§
source§impl Ord for Package
impl Ord for Package
source§impl PartialOrd for Package
impl PartialOrd for Package
impl Eq for Package
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes