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
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 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> 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> 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>
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