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
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,
§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