pub struct EncodableSourceId {
inner: SourceId,
encoded: bool,
}
Expand description
Pretty much equivalent to SourceId
with a different serialization method.
The serialization for SourceId
doesn’t do URL encode for parameters.
In contrast, this type is aware of that whenever ResolveVersion
allows
us to do so (v4 or later).
EncodableResolve
turns into a `
Fields§
§inner: SourceId
§encoded: bool
We don’t care about the deserialization of this, as the url
crate
will always decode as the URL was encoded. Only when a Resolve
turns into a EncodableResolve
will it set the value accordingly
via encodable_source_id
.
Implementations§
source§impl EncodableSourceId
impl EncodableSourceId
sourcefn without_url_encoded(inner: SourceId) -> Self
fn without_url_encoded(inner: SourceId) -> Self
Creates a EncodableSourceId
that doesn’t encode URL params. This is
for backward compatibility for order lockfile version.
Methods from Deref<Target = SourceId>§
sourcepub fn as_url(&self) -> SourceIdAsUrl<'_>
pub fn as_url(&self) -> SourceIdAsUrl<'_>
A view of the SourceId
that can be Display
ed as a URL.
sourcepub fn as_encoded_url(&self) -> SourceIdAsUrl<'_>
pub fn as_encoded_url(&self) -> SourceIdAsUrl<'_>
Like Self::as_url
but with URL parameters encoded.
sourcepub fn canonical_url(&self) -> &CanonicalUrl
pub fn canonical_url(&self) -> &CanonicalUrl
Gets the canonical URL of this source, used for internal comparison purposes.
sourcepub fn alt_registry_key(&self) -> Option<&str>
pub fn alt_registry_key(&self) -> Option<&str>
Gets the name of the remote registry as defined in the [registries]
table,
or the built-in crates-io
key.
Trait Implementations§
source§impl Clone for EncodableSourceId
impl Clone for EncodableSourceId
source§fn clone(&self) -> EncodableSourceId
fn clone(&self) -> EncodableSourceId
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EncodableSourceId
impl Debug for EncodableSourceId
source§impl Deref for EncodableSourceId
impl Deref for EncodableSourceId
source§impl<'de> Deserialize<'de> for EncodableSourceId
impl<'de> Deserialize<'de> for EncodableSourceId
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Hash for EncodableSourceId
impl Hash for EncodableSourceId
source§impl Ord for EncodableSourceId
impl Ord for EncodableSourceId
source§fn cmp(&self, other: &EncodableSourceId) -> Ordering
fn cmp(&self, other: &EncodableSourceId) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<EncodableSourceId> for EncodableSourceId
impl PartialEq<EncodableSourceId> for EncodableSourceId
source§impl PartialOrd<EncodableSourceId> for EncodableSourceId
impl PartialOrd<EncodableSourceId> for EncodableSourceId
source§fn partial_cmp(&self, other: &EncodableSourceId) -> Option<Ordering>
fn partial_cmp(&self, other: &EncodableSourceId) -> 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 moresource§impl Serialize for EncodableSourceId
impl Serialize for EncodableSourceId
impl Eq for EncodableSourceId
Auto Trait Implementations§
impl RefUnwindSafe for EncodableSourceId
impl Send for EncodableSourceId
impl Sync for EncodableSourceId
impl Unpin for EncodableSourceId
impl UnwindSafe for EncodableSourceId
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> Serialize for Twhere
T: Serialize + ?Sized,
impl<T> Serialize for Twhere T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
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>
impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,
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: 16 bytes