pub struct LifecycleEvent {
pub from_state: GovernedArtifactState,
pub to_state: GovernedArtifactState,
pub timestamp: String,
pub actor: String,
pub reason: String,
pub ticket_ref: Option<String>,
pub tenant_id: Option<String>,
}Expand description
Record of a lifecycle state change.
Every state transition is recorded with:
- Who/what initiated the change
- Why the change was made
- When it occurred
- Optional reference to approval/review ticket
§Audit Trail
LifecycleEvents form an append-only audit trail that captures the full history of an artifact’s governance journey.
Fields§
§from_state: GovernedArtifactStatePrevious state
to_state: GovernedArtifactStateNew state
timestamp: StringISO 8601 timestamp
actor: StringWho or what initiated the change (user, system, policy engine)
reason: StringReason for the state change
ticket_ref: Option<String>Optional link to approval/review ticket
tenant_id: Option<String>Optional tenant scope (if transition is tenant-specific)
Implementations§
Source§impl LifecycleEvent
impl LifecycleEvent
Sourcepub fn new(
from_state: GovernedArtifactState,
to_state: GovernedArtifactState,
actor: impl Into<String>,
reason: impl Into<String>,
) -> LifecycleEvent
pub fn new( from_state: GovernedArtifactState, to_state: GovernedArtifactState, actor: impl Into<String>, reason: impl Into<String>, ) -> LifecycleEvent
Create a new lifecycle event with current timestamp.
Note: For portability, this uses a simple ISO 8601 string. Production systems should inject the timestamp from a trusted source.
Sourcepub fn with_ticket(self, ticket: impl Into<String>) -> LifecycleEvent
pub fn with_ticket(self, ticket: impl Into<String>) -> LifecycleEvent
Add a ticket reference.
Sourcepub fn with_tenant(self, tenant_id: impl Into<String>) -> LifecycleEvent
pub fn with_tenant(self, tenant_id: impl Into<String>) -> LifecycleEvent
Add tenant scope.
Sourcepub fn with_timestamp(self, timestamp: impl Into<String>) -> LifecycleEvent
pub fn with_timestamp(self, timestamp: impl Into<String>) -> LifecycleEvent
Set explicit timestamp (for replay/testing).
Trait Implementations§
Source§impl Clone for LifecycleEvent
impl Clone for LifecycleEvent
Source§fn clone(&self) -> LifecycleEvent
fn clone(&self) -> LifecycleEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LifecycleEvent
impl Debug for LifecycleEvent
Source§impl<'de> Deserialize<'de> for LifecycleEvent
impl<'de> Deserialize<'de> for LifecycleEvent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LifecycleEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LifecycleEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for LifecycleEvent
impl Serialize for LifecycleEvent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for LifecycleEvent
impl RefUnwindSafe for LifecycleEvent
impl Send for LifecycleEvent
impl Sync for LifecycleEvent
impl Unpin for LifecycleEvent
impl UnsafeUnpin for LifecycleEvent
impl UnwindSafe for LifecycleEvent
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