Enum DependencySource
pub enum DependencySource {
AssemblyRef(AssemblyRefRc),
ModuleRef(ModuleRefRc),
File(FileRc),
}Expand description
Source of a dependency relationship within .NET metadata.
This enum identifies which metadata table and specific entry generated a dependency relationship. This information is crucial for:
- Debugging: Tracing dependency issues back to metadata source
- Resolution: Understanding dependency semantics and requirements
- Validation: Ensuring dependency relationships are semantically valid
- Analysis: Building comprehensive dependency reports
§Metadata Table Integration
Each variant corresponds to a specific .NET metadata table:
DependencySource::AssemblyRef↔AssemblyReftable (0x23)DependencySource::ModuleRef↔ModuleReftable (0x1A)DependencySource::File↔Filetable (0x26)
Variants§
AssemblyRef(AssemblyRefRc)
Dependency from an AssemblyRef table entry
This is the most common dependency source, representing a standard
reference to an external assembly. Contains the complete AssemblyRef
metadata including version, culture, and strong name information.
ModuleRef(ModuleRefRc)
Dependency from a ModuleRef table entry
Represents a reference to an external module, typically in multi-module assemblies or for P/Invoke scenarios. Less common in modern .NET applications.
File(FileRc)
Dependency from a File table entry
Represents a file within a multi-file assembly. These are intra-assembly dependencies rather than cross-assembly dependencies, but are tracked for completeness and assembly integrity verification.
Implementations§
§impl DependencySource
impl DependencySource
pub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Get the display name for this dependency source.
Returns a human-readable identifier for the dependency source, useful for debugging and error reporting.
§Returns
A string slice containing the source’s display name
pub fn dependency_type(&self) -> DependencyType
pub fn dependency_type(&self) -> DependencyType
Get the dependency type based on the source metadata.
Analyzes the source metadata to determine the appropriate dependency type classification. This enables proper handling of different dependency relationship semantics.
§Returns
The dependency type that best represents this source’s semantics
Trait Implementations§
§impl Clone for DependencySource
impl Clone for DependencySource
§fn clone(&self) -> DependencySource
fn clone(&self) -> DependencySource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for DependencySource
impl Debug for DependencySource
§impl Display for DependencySource
impl Display for DependencySource
impl Eq for DependencySource
§impl PartialEq for DependencySource
impl PartialEq for DependencySource
§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
Compare dependency sources for equality.
Two dependency sources are considered equal if they refer to the same dependency, based on the identifying metadata:
- AssemblyRef: Same name, version, culture, and public key token
- ModuleRef: Same module name
- File: Same file name
Different source types are never equal.
§Examples
use dotscope::metadata::dependencies::DependencySource;
use dotscope::metadata::identity::AssemblyIdentity;
let id = AssemblyIdentity::parse("Test, Version=1.0.0.0").unwrap();
let source1 = DependencySource::AssemblyRef(id.clone());
let source2 = DependencySource::AssemblyRef(id);
// Two AssemblyRef sources to the same assembly are equal
assert_eq!(source1, source2);Auto Trait Implementations§
impl Freeze for DependencySource
impl RefUnwindSafe for DependencySource
impl Send for DependencySource
impl Sync for DependencySource
impl Unpin for DependencySource
impl UnsafeUnpin for DependencySource
impl UnwindSafe for DependencySource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more