pub struct PatchEvent {
pub action: PatchAction,
pub purl: Option<String>,
pub uuid: Option<String>,
pub old_uuid: Option<String>,
pub files: Vec<PatchEventFile>,
pub reason: Option<String>,
pub error_code: Option<String>,
pub error: Option<String>,
pub details: Option<Value>,
}Expand description
One observable thing that happened during a run.
Fields§
§action: PatchActionWhat happened. See PatchAction for the full vocabulary.
purl: Option<String>The package PURL this event is about, when applicable. Always set for patch-level events; omitted for artifact-level events that don’t trace to a specific package.
uuid: Option<String>The patch UUID, when known. Always set when the event is about a specific patch record; omitted for cleanup events that affect many patches at once.
old_uuid: Option<String>The UUID this patch replaced. Set only on Updated events so a
consumer can diff a manifest update — the new UUID lives in
uuid, the one it overwrote here. Omitted for every other action.
files: Vec<PatchEventFile>Files touched by an Applied / Verified / Removed event.
Empty for actions that don’t operate on files (e.g. Downloaded).
reason: Option<String>Human-readable explanation for Skipped or Failed events.
Machine consumers should prefer error_code for routing decisions.
error_code: Option<String>Stable, lowercase, snake_case reason tag for programmatic routing.
Examples: already_patched, package_not_installed,
hash_mismatch, no_local_source, paid_required.
error: Option<String>Underlying error message for Failed events.
details: Option<Value>Command-specific additional fields. Consumers MUST NOT depend on
the shape of this object — different subcommands attach different
keys here. Used today for list (vulnerabilities, license, tier,
description) and scan (discovered metadata not covered by the
other event fields).
Implementations§
Source§impl PatchEvent
impl PatchEvent
Sourcepub fn new(action: PatchAction, purl: impl Into<String>) -> Self
pub fn new(action: PatchAction, purl: impl Into<String>) -> Self
Construct an event with only the required action and purl.
Use the with_* builders to attach optional fields.
Sourcepub fn artifact(action: PatchAction) -> Self
pub fn artifact(action: PatchAction) -> Self
Construct an event that isn’t scoped to a single package (e.g. a repair run that swept orphan blobs).
pub fn with_uuid(self, uuid: impl Into<String>) -> Self
Sourcepub fn with_old_uuid(self, old_uuid: impl Into<String>) -> Self
pub fn with_old_uuid(self, old_uuid: impl Into<String>) -> Self
Attach the UUID this event’s patch replaced. Use on Updated
events so consumers can diff against the prior manifest entry;
serializes as oldUuid.
pub fn with_files(self, files: Vec<PatchEventFile>) -> Self
pub fn with_reason( self, code: impl Into<String>, message: impl Into<String>, ) -> Self
pub fn with_error( self, code: impl Into<String>, message: impl Into<String>, ) -> Self
Sourcepub fn with_details(self, details: Value) -> Self
pub fn with_details(self, details: Value) -> Self
Attach command-specific extra fields. See PatchEvent::details
for the contract — consumers should not depend on the shape.
Trait Implementations§
Source§impl Clone for PatchEvent
impl Clone for PatchEvent
Source§fn clone(&self) -> PatchEvent
fn clone(&self) -> PatchEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PatchEvent
impl Debug for PatchEvent
Auto Trait Implementations§
impl Freeze for PatchEvent
impl RefUnwindSafe for PatchEvent
impl Send for PatchEvent
impl Sync for PatchEvent
impl Unpin for PatchEvent
impl UnsafeUnpin for PatchEvent
impl UnwindSafe for PatchEvent
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,
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>
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>
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