pub struct WorkspacePackageRef<'a> { /* private fields */ }Expand description
Facade for cargo_metadata ::Package
Implementations§
Source§impl<'a> WorkspacePackageRef<'a>
impl<'a> WorkspacePackageRef<'a>
Sourcepub fn dependencies(
&'a self,
) -> Map<Iter<'a, Dependency>, fn(&'a Dependency) -> DependencyRef<'a>>
pub fn dependencies( &'a self, ) -> Map<Iter<'a, Dependency>, fn(&'a Dependency) -> DependencyRef<'a>>
List of dependencies of this particular package
Sourcepub fn manifest_file(&self) -> Result<ManifestFile, PathError>
pub fn manifest_file(&self) -> Result<ManifestFile, PathError>
Sourcepub fn publish(&self) -> Option<&Vec<String>>
pub fn publish(&self) -> Option<&Vec<String>>
List of registries to which this package may be published (derived from the publish field). Publishing is unrestricted if None, and forbidden if the Vec is empty. This is always None if running with a version of Cargo older than 1.39.
Sourcepub fn metadata(&self) -> &Value
pub fn metadata(&self) -> &Value
Contents of the free form package.metadata section. This contents can be serialized to a struct using serde :
use serde ::Deserialize;
use serde_json ::json;
#[ derive( Debug, Deserialize ) ]
struct SomePackageMetadata
{
some_value: i32,
}
fn main()
{
let value = json!
({
"some_value" : 42,
});
let package_metadata: SomePackageMetadata = serde_json ::from_value( value ).unwrap();
assert_eq!( package_metadata.some_value, 42 );
}Sourcepub fn repository(&self) -> Option<&String>
pub fn repository(&self) -> Option<&String>
The repository URL as specified in the Cargo.toml
Trait Implementations§
Source§impl AsCode for WorkspacePackageRef<'_>
impl AsCode for WorkspacePackageRef<'_>
Source§impl<'a> Clone for WorkspacePackageRef<'a>
impl<'a> Clone for WorkspacePackageRef<'a>
Source§fn clone(&self) -> WorkspacePackageRef<'a>
fn clone(&self) -> WorkspacePackageRef<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CodeItems for WorkspacePackageRef<'_>
impl CodeItems for WorkspacePackageRef<'_>
Source§impl<'a> Debug for WorkspacePackageRef<'a>
impl<'a> Debug for WorkspacePackageRef<'a>
Source§impl Entries for WorkspacePackageRef<'_>
impl Entries for WorkspacePackageRef<'_>
Source§fn entries(&self) -> impl IterTrait<'_, SourceFile>
fn entries(&self) -> impl IterTrait<'_, SourceFile>
Returns an iterator over the entries.
Source§impl<'a> From<&'a Package> for WorkspacePackageRef<'a>
impl<'a> From<&'a Package> for WorkspacePackageRef<'a>
Source§impl<'a> From<&WorkspacePackageRef<'a>> for CrateId
impl<'a> From<&WorkspacePackageRef<'a>> for CrateId
Source§fn from(value: &WorkspacePackageRef<'a>) -> Self
fn from(value: &WorkspacePackageRef<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<WorkspacePackageRef<'a>> for Package<'a>
impl<'a> From<WorkspacePackageRef<'a>> for Package<'a>
Source§fn from(value: WorkspacePackageRef<'a>) -> Self
fn from(value: WorkspacePackageRef<'a>) -> Self
Converts to this type from the input type.
Source§impl Sources for WorkspacePackageRef<'_>
impl Sources for WorkspacePackageRef<'_>
Source§fn sources(&self) -> impl IterTrait<'_, SourceFile>
fn sources(&self) -> impl IterTrait<'_, SourceFile>
Returns an iterator over the source files.
impl<'a> Copy for WorkspacePackageRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for WorkspacePackageRef<'a>
impl<'a> RefUnwindSafe for WorkspacePackageRef<'a>
impl<'a> Send for WorkspacePackageRef<'a>
impl<'a> Sync for WorkspacePackageRef<'a>
impl<'a> Unpin for WorkspacePackageRef<'a>
impl<'a> UnwindSafe for WorkspacePackageRef<'a>
Blanket Implementations§
Source§impl<S> AssignWithType for S
impl<S> AssignWithType for S
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
Source§type Val = <C as Collection>::Val
type Val = <C as Collection>::Val
The type of values stored in the collection. This might be distinct from
Entry in complex collections.
For example, in a HashMap, while Entry might be a ( key, value ) tuple, Val might only be the value part.Source§fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
Converts an entry into a value representation specific to the type of collection. This conversion is crucial
for handling operations on entries, especially when they need to be treated or accessed as individual values,
such as retrieving the value part from a key-value pair in a hash map.
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<Initial, Error, Final> TransitiveTryFrom<Error, Initial> for Final
impl<Initial, Error, Final> TransitiveTryFrom<Error, Initial> for Final
Source§impl<Error, Final, Initial> TransitiveTryInto<Error, Final> for Initial
impl<Error, Final, Initial> TransitiveTryInto<Error, Final> for Initial
Source§impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
Source§fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
Invokes the val_to_entry function of the CollectionValToEntry trait to convert the value to an entry.
Source§type Entry = <C as CollectionValToEntry<Val>>::Entry
type Entry = <C as CollectionValToEntry<Val>>::Entry
Represents the type of entry that corresponds to the value within the collection.
Type
Entry is defined by the Collection trait.