Struct cargo::util::CanonicalUrl
source · [−]pub struct CanonicalUrl(_);
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
sourceimpl 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
sourceimpl Clone for CanonicalUrl
impl Clone for CanonicalUrl
sourcefn clone(&self) -> CanonicalUrl
fn clone(&self) -> CanonicalUrl
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CanonicalUrl
impl Debug for CanonicalUrl
sourceimpl Hash for CanonicalUrl
impl Hash for CanonicalUrl
sourceimpl Ord for CanonicalUrl
impl Ord for CanonicalUrl
sourceimpl PartialEq<CanonicalUrl> for CanonicalUrl
impl PartialEq<CanonicalUrl> for CanonicalUrl
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &CanonicalUrl) -> bool
fn ne(&self, other: &CanonicalUrl) -> bool
This method tests for !=
.
sourceimpl PartialOrd<CanonicalUrl> for CanonicalUrl
impl PartialOrd<CanonicalUrl> for CanonicalUrl
sourcefn partial_cmp(&self, other: &CanonicalUrl) -> Option<Ordering>
fn partial_cmp(&self, other: &CanonicalUrl) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more