pub enum IndexSummary {
Candidate(Summary),
Yanked(Summary),
Offline(Summary),
Unsupported(Summary, u32),
}
Expand description
A parsed representation of a summary from the index. This is usually parsed from a line from a raw index file, or a JSON blob from on-disk index cache.
In addition to a full Summary
, we have information on whether it is yanked
.
Variants§
Candidate(Summary)
Available for consideration
Yanked(Summary)
Yanked within its registry
Offline(Summary)
Not available as we are offline and create is not downloaded yet
Unsupported(Summary, u32)
From a newer schema version and is likely incomplete or inaccurate
Implementations§
Source§impl IndexSummary
impl IndexSummary
Sourcepub fn as_summary(&self) -> &Summary
pub fn as_summary(&self) -> &Summary
Extract the summary from any variant
Sourcepub fn into_summary(self) -> Summary
pub fn into_summary(self) -> Summary
Extract the summary from any variant
pub fn map_summary(self, f: impl Fn(Summary) -> Summary) -> Self
Sourcepub fn package_id(&self) -> PackageId
pub fn package_id(&self) -> PackageId
Extract the package id from any variant
Sourcepub fn is_offline(&self) -> bool
pub fn is_offline(&self) -> bool
Returns true
if the index summary is Offline
.
Source§impl IndexSummary
impl IndexSummary
Sourcefn parse(
line: &[u8],
source_id: SourceId,
bindeps: bool,
) -> CargoResult<IndexSummary>
fn parse( line: &[u8], source_id: SourceId, bindeps: bool, ) -> CargoResult<IndexSummary>
Parses a line from the registry’s index file into an IndexSummary
for a package.
The line
provided is expected to be valid JSON. It is supposed to be
a IndexPackage
.
Trait Implementations§
Source§impl Clone for IndexSummary
impl Clone for IndexSummary
Source§fn clone(&self) -> IndexSummary
fn clone(&self) -> IndexSummary
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for IndexSummary
impl Debug for IndexSummary
Source§impl From<IndexSummary> for MaybeIndexSummary
impl From<IndexSummary> for MaybeIndexSummary
Source§fn from(summary: IndexSummary) -> MaybeIndexSummary
fn from(summary: IndexSummary) -> MaybeIndexSummary
Auto Trait Implementations§
impl Freeze for IndexSummary
impl RefUnwindSafe for IndexSummary
impl Send for IndexSummary
impl Sync for IndexSummary
impl Unpin for IndexSummary
impl UnwindSafe for IndexSummary
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<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: 16 bytes
Size for each variant:
Candidate
: 12 bytesYanked
: 12 bytesOffline
: 12 bytesUnsupported
: 12 bytes