Skip to main content

PypiIndexConfig

Struct PypiIndexConfig 

Source
pub struct PypiIndexConfig { /* private fields */ }
Expand description

Resolved index configuration for one requirements.txt/pyproject.toml file.

Built once per parse (two-pass for requirements.txt — see parser::requirements’s module doc; single-pass for pyproject.toml, whose TOML tree is fully available before any dependency is resolved), consulted per-dependency via Self::resolve_source_for.

Implementations§

Source§

impl PypiIndexConfig

Source

pub fn new() -> Self

An empty config — every dependency resolves to plain DependencySource::Registry, byte-identical to today (US-004).

Source

pub fn set_primary(&mut self, raw: &str, policy: &RegistryAccessPolicy)

FR-002: sets (overwriting any prior value) the explicit --index-url/Poetry primary-equivalent primary. Matches pip’s own argparse store semantics for --index-url (not append, unlike --extra-index-url) — the last occurrence in a file wins.

Source

pub fn add_extra(&mut self, raw: &str, policy: &RegistryAccessPolicy)

FR-003: appends an --extra-index-url/Poetry supplemental-priority/uv non-default entry to the fallback chain, in declaration order.

Source

pub fn resolve_source_for(&self, named_source: Option<&str>) -> DependencySource

FR-002/FR-003/FR-005/FR-006/FR-007/FR-013: resolves one dependency’s DependencySource.

named_source is Some("internal") for a dependency declaring source = "internal" (Poetry) or an index = "internal" uv-sources binding; None for every other dependency (routes through primary/extras/tail_hop per FR-005 instead).

Source

pub fn resolved_chains(&self) -> Vec<ResolvedChain>

Every chain this config implies, ready for registration — FR-005(a)/(b) resolved to concrete hop lists, plus one single-hop chain per valid named source. Empty when the file declares nothing (US-004) or when every case-(b) hop turned out invalid with no explicit primary (N5’s zero-hop case — Self::resolve_source_for returns plain Registry in that case, and there is nothing to register).

Trait Implementations§

Source§

impl Debug for PypiIndexConfig

Source§

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

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

impl Default for PypiIndexConfig

Source§

fn default() -> PypiIndexConfig

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

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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
§

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

§

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
§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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