pub struct Pool {
pub identity: u64,
pub packages: Vec<usize>,
pub unacceptable_fixed_or_locked: Vec<usize>,
pub warnings: Vec<String>,
pub filter_list_removed: FilterListRemoved,
pub security_removed: BTreeMap<String, Vec<(String, Vec<String>)>>,
pub abandoned_removed: BTreeMap<String, BTreeMap<String, String>>,
pub removed_versions: BTreeMap<String, BTreeMap<String, String>>,
pub removed_versions_by_package: BTreeMap<usize, BTreeMap<String, String>>,
/* private fields */
}Fields§
§identity: u64Pool identity (spl_object_id($pool) in Composer): the policy caches
are keyed by pool.
packages: Vec<usize>id - 1 -> arena index.
unacceptable_fixed_or_locked: Vec<usize>§warnings: Vec<String>§filter_list_removed: FilterListRemovedfilterListRemovedVersions: what a filter list removed (the rule
generator and the solver consult it).
security_removed: BTreeMap<String, Vec<(String, Vec<String>)>>securityRemovedVersions: name (own name and replaced names) ->
[(normalized version, advisory ids)] in pool order (messages only).
abandoned_removed: BTreeMap<String, BTreeMap<String, String>>abandonedRemovedVersions: name -> normalized version -> pretty.
removed_versions: BTreeMap<String, BTreeMap<String, String>>removedVersions: name -> normalized version -> pretty version of
the packages the PoolOptimizer dropped (messages only).
removed_versions_by_package: BTreeMap<usize, BTreeMap<String, String>>removedVersionsByPackage: arena index of a kept package -> the
versions it stands for (recordRemovedVersionsForPackage).
Implementations§
Source§impl Pool
impl Pool
pub fn new( packages: Vec<usize>, unacceptable: Vec<usize>, arena: &[Package], ) -> Pool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn package_by_id(&self, id: usize) -> usize
pub fn package_by_id(&self, id: usize) -> usize
packageById -> arena index.
pub fn id_of(&self, arena_idx: usize) -> Option<usize>
pub fn literal_to_package(&self, literal: i64) -> usize
Sourcepub fn what_provides(
&self,
arena: &[Package],
name: &str,
constraint: Option<&Constraint>,
) -> Vec<usize>
pub fn what_provides( &self, arena: &[Package], name: &str, constraint: Option<&Constraint>, ) -> Vec<usize>
whatProvides -> pool ids.
Sourcepub fn matches(
candidate: &Package,
name: &str,
constraint: Option<&Constraint>,
) -> bool
pub fn matches( candidate: &Package, name: &str, constraint: Option<&Constraint>, ) -> bool
Pool::match.
Sourcepub fn is_filter_list_removed(&self, name: &str, version: &str) -> bool
pub fn is_filter_list_removed(&self, name: &str, version: &str) -> bool
isFilterListRemovedPackageVersion($name, Constraint('==', $version)).
Sourcepub fn with_packages(&self, kept: Vec<usize>, arena: &[Package]) -> Pool
pub fn with_packages(&self, kept: Vec<usize>, arena: &[Package]) -> Pool
The same pool reduced to kept (renumbered ids), removed versions
and warnings preserved.
Sourcepub fn is_security_removed(&self, name: &str, constraint: &Constraint) -> bool
pub fn is_security_removed(&self, name: &str, constraint: &Constraint) -> bool
isSecurityRemovedPackageVersion.
Sourcepub fn security_advisory_ids(
&self,
name: &str,
constraint: &Constraint,
) -> Vec<String>
pub fn security_advisory_ids( &self, name: &str, constraint: &Constraint, ) -> Vec<String>
getSecurityAdvisoryIdentifiersForPackageVersion: the ids of the
first removed version matching the constraint.
Sourcepub fn is_abandoned_removed(&self, name: &str, constraint: &Constraint) -> bool
pub fn is_abandoned_removed(&self, name: &str, constraint: &Constraint) -> bool
isAbandonedRemovedPackageVersion.
Sourcepub fn is_filter_list_removed_version(
&self,
name: &str,
constraint: &Constraint,
) -> bool
pub fn is_filter_list_removed_version( &self, name: &str, constraint: &Constraint, ) -> bool
isFilterListRemovedPackageVersion.
Sourcepub fn filter_list_entries_text(
&self,
name: &str,
constraint: &Constraint,
) -> Vec<(String, String)>
pub fn filter_list_entries_text( &self, name: &str, constraint: &Constraint, ) -> Vec<(String, String)>
getFilterListEntryForPackageVersion: list name -> text
(“flagged as malware reported by … (see …) reason: …”).
pub fn is_unacceptable_fixed_or_locked(&self, arena_idx: usize) -> bool
Sourcepub fn removed_versions(
&self,
name: &str,
constraint: &Constraint,
) -> Vec<(String, String)>
pub fn removed_versions( &self, name: &str, constraint: &Constraint, ) -> Vec<(String, String)>
getRemovedVersions: the removed versions of name matching the
constraint, in recording order.