pub enum GoProxyUrlError {
InvalidUrl(String),
NotHttps(String),
UserInfoPresent,
BlockedHost {
class: HostClass,
},
}Expand description
Why a candidate GOPROXY hop URL failed GoProxyUrl::new’s validation.
An alias of the shared deps_core::net_policy::IndexUrlError — see that type’s docs for
the variants and their wording.
Why a candidate registry/index URL failed validate_index_url.
Shared by deps-cargo, deps-npm, and deps-pypi — each ecosystem crate either
re-exports this directly (deps-cargo, deps-pypi) or wraps it in its own
From-mapped error enum (deps-npm, which needs an extra ${VAR}-expansion variant).
§Examples
use deps_core::net_policy::{IndexUrlError, PolicyGate, validate_index_url};
let err = validate_index_url("not a url", "not a url", "cargo", PolicyGate::Skip).unwrap_err();
assert_eq!(err, IndexUrlError::InvalidUrl("not a url".to_string()));Variants§
InvalidUrl(String)
The value did not parse as a URL at all.
NotHttps(String)
The URL’s scheme is not https.
UserInfoPresent
The URL carries a user:pass@/user@ component.
BlockedHost
The candidate’s host is blocked by the current WorkspaceRegistryAccess policy.
Trait Implementations§
Source§impl Clone for IndexUrlError
impl Clone for IndexUrlError
Source§fn clone(&self) -> IndexUrlError
fn clone(&self) -> IndexUrlError
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 IndexUrlError
impl Debug for IndexUrlError
Source§impl Display for IndexUrlError
impl Display for IndexUrlError
impl Eq for IndexUrlError
Source§impl Error for IndexUrlError
impl Error for IndexUrlError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for IndexUrlError
impl PartialEq for IndexUrlError
Source§fn eq(&self, other: &IndexUrlError) -> bool
fn eq(&self, other: &IndexUrlError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for IndexUrlError
Auto Trait Implementations§
impl Freeze for IndexUrlError
impl RefUnwindSafe for IndexUrlError
impl Send for IndexUrlError
impl Sync for IndexUrlError
impl Unpin for IndexUrlError
impl UnsafeUnpin for IndexUrlError
impl UnwindSafe for IndexUrlError
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.