pub struct TopLevelDependency {Show 14 fields
pub purl: Option<String>,
pub extracted_requirement: Option<String>,
pub scope: Option<String>,
pub is_runtime: Option<bool>,
pub is_optional: Option<bool>,
pub is_pinned: Option<bool>,
pub is_direct: Option<bool>,
pub resolved_package: Option<Box<ResolvedPackage>>,
pub extra_data: Option<HashMap<String, Value>>,
pub dependency_uid: String,
pub for_package_uid: Option<String>,
pub datafile_path: String,
pub datasource_id: DatasourceId,
pub namespace: Option<String>,
}Expand description
Top-level dependency instance, created during package assembly.
Extends the file-level Dependency with traceability fields that link
each dependency to its owning package and source datafile.
Fields§
§purl: Option<String>§extracted_requirement: Option<String>§scope: Option<String>§is_runtime: Option<bool>§is_optional: Option<bool>§is_pinned: Option<bool>§is_direct: Option<bool>§resolved_package: Option<Box<ResolvedPackage>>§extra_data: Option<HashMap<String, Value>>§dependency_uid: StringUnique identifier for this dependency instance (PURL with UUID qualifier).
for_package_uid: Option<String>The package_uid of the package this dependency belongs to.
datafile_path: StringPath to the datafile where this dependency was declared.
datasource_id: DatasourceIdDatasource identifier for the parser that extracted this dependency.
namespace: Option<String>Namespace for the dependency (e.g., distribution name for RPM packages).
Implementations§
Source§impl TopLevelDependency
impl TopLevelDependency
Sourcepub fn from_dependency(
dep: &Dependency,
datafile_path: String,
datasource_id: DatasourceId,
for_package_uid: Option<String>,
) -> Self
pub fn from_dependency( dep: &Dependency, datafile_path: String, datasource_id: DatasourceId, for_package_uid: Option<String>, ) -> Self
Create a TopLevelDependency from a file-level Dependency.
Trait Implementations§
Source§impl Clone for TopLevelDependency
impl Clone for TopLevelDependency
Source§fn clone(&self) -> TopLevelDependency
fn clone(&self) -> TopLevelDependency
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 Debug for TopLevelDependency
impl Debug for TopLevelDependency
Source§impl<'de> Deserialize<'de> for TopLevelDependency
impl<'de> Deserialize<'de> for TopLevelDependency
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TopLevelDependency
impl RefUnwindSafe for TopLevelDependency
impl Send for TopLevelDependency
impl Sync for TopLevelDependency
impl Unpin for TopLevelDependency
impl UnsafeUnpin for TopLevelDependency
impl UnwindSafe for TopLevelDependency
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,
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>
Converts
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>
Converts
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 more