#[non_exhaustive]pub struct DependencyReference { /* private fields */ }Expand description
One dependency syntax occurrence extracted from a Rust source file.
Implementations§
Source§impl DependencyReference
impl DependencyReference
Sourcepub fn source(&self) -> &str
pub fn source(&self) -> &str
Returns the normalized workspace-relative file containing the syntax.
Sourcepub fn referenced_path(&self) -> &str
pub fn referenced_path(&self) -> &str
Returns the Rust path before Cargo-aware external classification.
Sourcepub const fn target(&self) -> Option<&DependencyTarget>
pub const fn target(&self) -> Option<&DependencyTarget>
Returns the classified destination, or None when a diagnostic prevented classification.
Sourcepub fn internal_target(&self) -> Option<&str>
pub fn internal_target(&self) -> Option<&str>
Returns the resolved workspace file when the target is internal.
Sourcepub fn external_target(&self) -> Option<&str>
pub fn external_target(&self) -> Option<&str>
Returns the Cargo-visible crate name when the target is external.
Sourcepub const fn kind(&self) -> ImportKind
pub const fn kind(&self) -> ImportKind
Returns the Rust syntax category that produced the reference.
Trait Implementations§
Source§impl Clone for DependencyReference
impl Clone for DependencyReference
Source§fn clone(&self) -> DependencyReference
fn clone(&self) -> DependencyReference
Returns a copy 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 Debug for DependencyReference
impl Debug for DependencyReference
Source§impl Hash for DependencyReference
impl Hash for DependencyReference
Source§impl Ord for DependencyReference
impl Ord for DependencyReference
Source§fn cmp(&self, other: &DependencyReference) -> Ordering
fn cmp(&self, other: &DependencyReference) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DependencyReference
impl PartialEq for DependencyReference
Source§impl PartialOrd for DependencyReference
impl PartialOrd for DependencyReference
impl Eq for DependencyReference
impl StructuralPartialEq for DependencyReference
Auto Trait Implementations§
impl Freeze for DependencyReference
impl RefUnwindSafe for DependencyReference
impl Send for DependencyReference
impl Sync for DependencyReference
impl Unpin for DependencyReference
impl UnwindSafe for DependencyReference
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
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.