pub struct ComponentChange {
pub id: String,
pub canonical_id: Option<CanonicalId>,
pub component_ref: Option<ComponentRef>,
pub old_canonical_id: Option<CanonicalId>,
pub name: String,
pub old_version: Option<String>,
pub new_version: Option<String>,
pub ecosystem: Option<String>,
pub change_type: ChangeType,
pub field_changes: Vec<FieldChange>,
pub cost: u32,
pub match_info: Option<MatchInfo>,
}Expand description
Component change information
Fields§
§id: StringComponent canonical ID (string for serialization)
canonical_id: Option<CanonicalId>Typed canonical ID for navigation (skipped in JSON output for backward compat)
component_ref: Option<ComponentRef>Component reference with ID and name together
old_canonical_id: Option<CanonicalId>Old component ID (for modified components)
name: StringComponent name
old_version: Option<String>Old version (if existed)
new_version: Option<String>New version (if exists)
ecosystem: Option<String>Ecosystem
change_type: ChangeTypeChange type
field_changes: Vec<FieldChange>Detailed field changes
cost: u32Associated cost
match_info: Option<MatchInfo>Match information (for modified components, explains how old/new were correlated)
Implementations§
Source§impl ComponentChange
impl ComponentChange
Sourcepub fn modified(
old: &Component,
new: &Component,
field_changes: Vec<FieldChange>,
cost: u32,
) -> Self
pub fn modified( old: &Component, new: &Component, field_changes: Vec<FieldChange>, cost: u32, ) -> Self
Create a component modification
Sourcepub fn modified_with_match(
old: &Component,
new: &Component,
field_changes: Vec<FieldChange>,
cost: u32,
match_info: MatchInfo,
) -> Self
pub fn modified_with_match( old: &Component, new: &Component, field_changes: Vec<FieldChange>, cost: u32, match_info: MatchInfo, ) -> Self
Create a component modification with match explanation
Sourcepub fn with_match_info(self, match_info: MatchInfo) -> Self
pub fn with_match_info(self, match_info: MatchInfo) -> Self
Add match information to an existing change
Sourcepub fn get_canonical_id(&self) -> CanonicalId
pub fn get_canonical_id(&self) -> CanonicalId
Get the typed canonical ID, falling back to parsing from string if needed
Sourcepub fn get_component_ref(&self) -> ComponentRef
pub fn get_component_ref(&self) -> ComponentRef
Get a ComponentRef for this change
Trait Implementations§
Source§impl Clone for ComponentChange
impl Clone for ComponentChange
Source§fn clone(&self) -> ComponentChange
fn clone(&self) -> ComponentChange
Returns a duplicate 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 moreSource§impl Debug for ComponentChange
impl Debug for ComponentChange
Source§impl<'de> Deserialize<'de> for ComponentChange
impl<'de> Deserialize<'de> for ComponentChange
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ComponentChange
impl RefUnwindSafe for ComponentChange
impl Send for ComponentChange
impl Sync for ComponentChange
impl Unpin for ComponentChange
impl UnsafeUnpin for ComponentChange
impl UnwindSafe for ComponentChange
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more