Skip to main content

Pool

Struct Pool 

Source
pub struct Pool {
    pub identity: u64,
    pub packages: Vec<usize>,
    pub unacceptable_fixed_or_locked: Vec<usize>,
    pub warnings: Vec<String>,
    pub flex_notice: Option<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: u64

Pool 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>§flex_notice: Option<String>

Flex’s Restricting packages listed in "symfony/symfony" to … notice, printed once by the caller before Updating dependencies.

§filter_list_removed: FilterListRemoved

filterListRemovedVersions: 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

Source

pub fn new( packages: Vec<usize>, unacceptable: Vec<usize>, arena: &[Package], ) -> Pool

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn package_by_id(&self, id: usize) -> usize

packageById -> arena index.

Source

pub fn id_of(&self, arena_idx: usize) -> Option<usize>

Source

pub fn literal_to_package(&self, literal: i64) -> usize

Source

pub fn what_provides( &self, arena: &[Package], name: &str, constraint: Option<&Constraint>, ) -> Vec<usize>

whatProvides -> pool ids.

Source

pub fn matches( candidate: &Package, name: &str, constraint: Option<&Constraint>, ) -> bool

Pool::match.

Source

pub fn is_filter_list_removed(&self, name: &str, version: &str) -> bool

isFilterListRemovedPackageVersion($name, Constraint('==', $version)).

Source

pub fn with_packages(&self, kept: Vec<usize>, arena: &[Package]) -> Pool

The same pool reduced to kept (renumbered ids), removed versions and warnings preserved.

Source

pub fn is_security_removed(&self, name: &str, constraint: &Constraint) -> bool

isSecurityRemovedPackageVersion.

Source

pub fn security_advisory_ids( &self, name: &str, constraint: &Constraint, ) -> Vec<String>

getSecurityAdvisoryIdentifiersForPackageVersion: the ids of the first removed version matching the constraint.

Source

pub fn is_abandoned_removed(&self, name: &str, constraint: &Constraint) -> bool

isAbandonedRemovedPackageVersion.

Source

pub fn is_filter_list_removed_version( &self, name: &str, constraint: &Constraint, ) -> bool

isFilterListRemovedPackageVersion.

Source

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: …”).

Source

pub fn is_unacceptable_fixed_or_locked(&self, arena_idx: usize) -> bool

Source

pub fn removed_versions( &self, name: &str, constraint: &Constraint, ) -> Vec<(String, String)>

getRemovedVersions: the removed versions of name matching the constraint, in recording order.

Source

pub fn removed_versions_by_package( &self, arena_idx: usize, ) -> Vec<(String, String)>

getRemovedVersionsByPackage.

Trait Implementations§

Source§

impl Clone for Pool

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Pool

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Pool

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Pool

§

impl RefUnwindSafe for Pool

§

impl Send for Pool

§

impl Sync for Pool

§

impl Unpin for Pool

§

impl UnsafeUnpin for Pool

§

impl UnwindSafe for Pool

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more