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).
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.
pub fn kind(&self) -> &SourceKind
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 for EncodableSourceId
impl PartialEq for EncodableSourceId
Source§impl PartialOrd for EncodableSourceId
impl PartialOrd for EncodableSourceId
Source§impl Serialize for EncodableSourceId
impl Serialize for EncodableSourceId
impl Eq for EncodableSourceId
Auto Trait Implementations§
impl Freeze for EncodableSourceId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§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>
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