Enum crates_index_diff::Change
source · pub enum Change {
Added(CrateVersion),
Unyanked(CrateVersion),
AddedAndYanked(CrateVersion),
Yanked(CrateVersion),
Deleted {
name: String,
versions: Vec<CrateVersion>,
},
}
Expand description
Identify a kind of change that occurred to a crate
Variants
Added(CrateVersion)
A crate version was added.
Unyanked(CrateVersion)
A crate version was unyanked.
AddedAndYanked(CrateVersion)
A crate version was added in a yanked state.
This can happen if we don’t see the commit that added them, so it appears to pop into existence yanked.
Knowing this should help to trigger the correct action, as simply Yanked
crates would be treated quite differently.
Yanked(CrateVersion)
A crate version was yanked.
Deleted
Fields
name: String
The name of the deleted crate.
versions: Vec<CrateVersion>
All of its versions that were deleted along with the file.
The name of the crate whose file was deleted, which implies all versions were deleted as well.
Implementations
sourceimpl Change
impl Change
sourcepub fn added(&self) -> Option<&CrateVersion>
pub fn added(&self) -> Option<&CrateVersion>
Return the added crate, if this is this kind of change.
sourcepub fn yanked(&self) -> Option<&CrateVersion>
pub fn yanked(&self) -> Option<&CrateVersion>
Return the yanked crate, if this is this kind of change.
sourcepub fn unyanked(&self) -> Option<&CrateVersion>
pub fn unyanked(&self) -> Option<&CrateVersion>
Return the unyanked crate, if this is this kind of change.
sourcepub fn deleted(&self) -> Option<(&str, &[CrateVersion])>
pub fn deleted(&self) -> Option<(&str, &[CrateVersion])>
Return the deleted crate, if this is this kind of change.
sourcepub fn versions(&self) -> &[CrateVersion]
pub fn versions(&self) -> &[CrateVersion]
Returns all versions affected by this change.
The returned slice usually has length 1. However, if a crate was purged from the index by an admin, all versions of the purged crate are returned.
Trait Implementations
impl Eq for Change
impl StructuralEq for Change
impl StructuralPartialEq for Change
Auto Trait Implementations
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnwindSafe for Change
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<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,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString
]. Read more