pub struct PypiIndexUrl { /* private fields */ }Expand description
A validated, normalized, https-only PyPI-protocol index URL with no embedded userinfo.
Mirrors deps_npm::config::NpmRegistryIndex (see FR-006/FR-011); kept deps-pypi-local
rather than promoted to deps-core per this spec’s Open Questions (consolidate only once a
third near-identical type makes the duplication concrete).
Implementations§
Source§impl PypiIndexUrl
impl PypiIndexUrl
Sourcepub fn new(
raw: &str,
policy: &RegistryAccessPolicy,
) -> Result<Self, PypiIndexUrlError>
pub fn new( raw: &str, policy: &RegistryAccessPolicy, ) -> Result<Self, PypiIndexUrlError>
Validates and normalizes raw against policy.
§Errors
Returns PypiIndexUrlError if raw does not parse as a URL, is not https (outside
the cfg(test)/test-util loopback carve-out), carries a userinfo component, or
resolves to a host class the current policy blocks.
§Examples
use deps_core::net_policy::RegistryAccessPolicy;
use deps_pypi::config::PypiIndexUrl;
let policy = RegistryAccessPolicy::default();
assert!(PypiIndexUrl::new("https://pypi.mycorp.example/simple", &policy).is_ok());
assert!(PypiIndexUrl::new("http://pypi.mycorp.example/simple", &policy).is_err());
assert!(PypiIndexUrl::new("https://user:pass@pypi.mycorp.example", &policy).is_err());Trait Implementations§
Source§impl Clone for PypiIndexUrl
impl Clone for PypiIndexUrl
Source§fn clone(&self) -> PypiIndexUrl
fn clone(&self) -> PypiIndexUrl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PypiIndexUrl
impl Debug for PypiIndexUrl
Source§impl Display for PypiIndexUrl
impl Display for PypiIndexUrl
impl Eq for PypiIndexUrl
Source§impl Hash for PypiIndexUrl
impl Hash for PypiIndexUrl
Source§impl PartialEq for PypiIndexUrl
impl PartialEq for PypiIndexUrl
Source§fn eq(&self, other: &PypiIndexUrl) -> bool
fn eq(&self, other: &PypiIndexUrl) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PypiIndexUrl
Auto Trait Implementations§
impl Freeze for PypiIndexUrl
impl RefUnwindSafe for PypiIndexUrl
impl Send for PypiIndexUrl
impl Sync for PypiIndexUrl
impl Unpin for PypiIndexUrl
impl UnsafeUnpin for PypiIndexUrl
impl UnwindSafe for PypiIndexUrl
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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