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 for CanonicalUrl
impl PartialEq for CanonicalUrl
Source§impl PartialOrd for CanonicalUrl
impl PartialOrd for CanonicalUrl
impl Eq for CanonicalUrl
impl StructuralPartialEq for CanonicalUrl
Auto Trait Implementations§
impl Freeze for CanonicalUrl
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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
§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
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>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§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>,
§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