pub struct RetrievedDependency {Show 13 fields
pub name: String,
pub version: String,
pub dependency_type: String,
pub url: Option<String>,
pub licenses: Option<Vec<String>>,
pub validated: bool,
pub is_valid: bool,
pub is_ignored: bool,
pub error: Option<String>,
pub comment: Option<Comment>,
pub suggested_licenses: Option<Vec<(String, f32)>>,
pub is_dev: Option<bool>,
pub is_optional: Option<bool>,
}
Expand description
A dependency that has been retrieved from its source. The source can be anything, from a third party API (i.e. npm, pub.dev or crates.io APIs) to the file system. It holds information about licenses, errors while validating…
Fields§
§name: String
Dependency name.
version: String
Dependency version.
dependency_type: String
Dependency type (npm, dart, rust, go, python…)
url: Option<String>
Url of the dependency if available.
licenses: Option<Vec<String>>
List of licenses of the dependency.
validated: bool
Set to true if the dependency has been validated against the licrc.
is_valid: bool
Indicates if the license is valid for our project or not according to our .licrc configuration file.
is_ignored: bool
Indicates if the dependency has been ignored according to our .licrc configuration file.
error: Option<String>
Contains information about any error that may have happened during the validation process.
comment: Option<Comment>
Comments about the license validation process.
suggested_licenses: Option<Vec<(String, f32)>>
In cases where the retriever makes some sort of estimate about the license, this field will contain the suggested licenses.
is_dev: Option<bool>
Indicates if the dependency is a dev dependency or not. This can be null if we cannot determine it.
is_optional: Option<bool>
Indicates if the dependency is an optional dependency or not. This can be null if we cannot determine it.
Implementations§
Source§impl RetrievedDependency
impl RetrievedDependency
Sourcepub fn new(
name: String,
version: String,
dependency_type: String,
url: Option<String>,
licenses: Option<Vec<String>>,
error: Option<String>,
comment: Option<Comment>,
suggested_licenses: Option<Vec<(String, f32)>>,
is_dev: Option<bool>,
is_optional: Option<bool>,
) -> Self
pub fn new( name: String, version: String, dependency_type: String, url: Option<String>, licenses: Option<Vec<String>>, error: Option<String>, comment: Option<Comment>, suggested_licenses: Option<Vec<(String, f32)>>, is_dev: Option<bool>, is_optional: Option<bool>, ) -> Self
Creates a new RetrievedDependency
with the given parameters.
Note that some properties will be automatically set depending on the other ones.
For example, if the licenses
parameter is None
, the is_valid
property will be set to false
.
Use the default method if you just want to create an instance with all the defaults.
This method it’s intended to be used once you have retrieved the dependency from its source (i.e. npm, github, etc).
Trait Implementations§
Source§impl Clone for RetrievedDependency
impl Clone for RetrievedDependency
Source§fn clone(&self) -> RetrievedDependency
fn clone(&self) -> RetrievedDependency
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more