Struct cargo::util::canonical_url::CanonicalUrl
source · pub struct CanonicalUrl(Url);
Expand description
A newtype wrapper around Url
which represents a “canonical” version of an
original URL.
A “canonical” url is only intended for internal comparison purposes in
Cargo. It’s to help paper over mistakes such as depending on
github.com/foo/bar
vs github.com/foo/bar.git
. This is only for
internal purposes within Cargo and provides no means to actually read the
underlying string value of the Url
it contains. This is intentional,
because all fetching should still happen within the context of the original
URL.
Tuple Fields§
§0: Url
Implementations§
source§impl CanonicalUrl
impl CanonicalUrl
pub fn new(url: &Url) -> CargoResult<CanonicalUrl>
sourcepub fn raw_canonicalized_url(&self) -> &Url
pub fn raw_canonicalized_url(&self) -> &Url
Returns the raw canonicalized URL, although beware that this should never be used/displayed/etc, it should only be used for internal data structures and hashes and such.
Trait Implementations§
source§impl Clone for CanonicalUrl
impl Clone for CanonicalUrl
source§fn clone(&self) -> CanonicalUrl
fn clone(&self) -> CanonicalUrl
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CanonicalUrl
impl Debug for CanonicalUrl
source§impl Hash for CanonicalUrl
impl Hash for CanonicalUrl
source§impl Ord for CanonicalUrl
impl Ord for CanonicalUrl
source§fn cmp(&self, other: &CanonicalUrl) -> Ordering
fn cmp(&self, other: &CanonicalUrl) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<CanonicalUrl> for CanonicalUrl
impl PartialEq<CanonicalUrl> for CanonicalUrl
source§fn eq(&self, other: &CanonicalUrl) -> bool
fn eq(&self, other: &CanonicalUrl) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<CanonicalUrl> for CanonicalUrl
impl PartialOrd<CanonicalUrl> for CanonicalUrl
source§fn partial_cmp(&self, other: &CanonicalUrl) -> Option<Ordering>
fn partial_cmp(&self, other: &CanonicalUrl) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for CanonicalUrl
impl StructuralEq for CanonicalUrl
impl StructuralPartialEq for CanonicalUrl
Auto Trait Implementations§
impl RefUnwindSafe for CanonicalUrl
impl Send for CanonicalUrl
impl Sync for CanonicalUrl
impl Unpin for CanonicalUrl
impl UnwindSafe for CanonicalUrl
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 88 bytes