Enum cargo::sources::registry::IndexSummary
source · 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
.
Trait Implementations§
source§impl Clone for IndexSummary
impl Clone for IndexSummary
source§fn clone(&self) -> IndexSummary
fn clone(&self) -> IndexSummary
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto 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
Mutably borrows from an owned value. Read more