Struct cargo::util::CanonicalUrl
source · pub struct CanonicalUrl(/* private fields */);
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.
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
Returns a copy of the value. Read more
1.0.0 · 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 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,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for CanonicalUrl
impl PartialEq for CanonicalUrl
source§fn eq(&self, other: &CanonicalUrl) -> bool
fn eq(&self, other: &CanonicalUrl) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for CanonicalUrl
impl PartialOrd 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
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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
Mutably borrows from an owned value. Read more
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.