pub struct MutationContext {
pub op_name: String,
pub actor: String,
pub events: Vec<Event>,
pub dirty_sessions: HashSet<String>,
pub dirty_issues: HashSet<String>,
pub dirty_items: HashSet<String>,
pub dirty_plans: HashSet<String>,
pub dirty_time_entries: HashSet<String>,
}Expand description
Context for a mutation operation, tracking side effects.
This struct is passed to mutation closures to:
- Track which entities were modified (dirty tracking for sync)
- Record audit events for history
- Manage transaction state
Fields§
§op_name: StringName of the operation being performed.
actor: StringActor performing the operation (agent ID, user, etc.).
events: Vec<Event>Events to write at the end of the transaction.
dirty_sessions: HashSet<String>IDs of entities marked dirty for sync export.
dirty_issues: HashSet<String>§dirty_items: HashSet<String>§dirty_plans: HashSet<String>§dirty_time_entries: HashSet<String>Implementations§
Source§impl MutationContext
impl MutationContext
Sourcepub fn record_event(
&mut self,
entity_type: &str,
entity_id: &str,
event_type: EventType,
)
pub fn record_event( &mut self, entity_type: &str, entity_id: &str, event_type: EventType, )
Record an event for this operation.
Sourcepub fn record_change(
&mut self,
entity_type: &str,
entity_id: &str,
event_type: EventType,
old_value: Option<String>,
new_value: Option<String>,
)
pub fn record_change( &mut self, entity_type: &str, entity_id: &str, event_type: EventType, old_value: Option<String>, new_value: Option<String>, )
Record an event with old/new values for field tracking.
Sourcepub fn mark_session_dirty(&mut self, session_id: &str)
pub fn mark_session_dirty(&mut self, session_id: &str)
Mark a session as dirty for sync export.
Sourcepub fn mark_issue_dirty(&mut self, issue_id: &str)
pub fn mark_issue_dirty(&mut self, issue_id: &str)
Mark an issue as dirty for sync export.
Sourcepub fn mark_item_dirty(&mut self, item_id: &str)
pub fn mark_item_dirty(&mut self, item_id: &str)
Mark a context item as dirty for sync export.
Sourcepub fn mark_plan_dirty(&mut self, plan_id: &str)
pub fn mark_plan_dirty(&mut self, plan_id: &str)
Mark a plan as dirty for sync export.
Sourcepub fn mark_time_entry_dirty(&mut self, time_entry_id: &str)
pub fn mark_time_entry_dirty(&mut self, time_entry_id: &str)
Mark a time entry as dirty for sync export.
Auto Trait Implementations§
impl Freeze for MutationContext
impl RefUnwindSafe for MutationContext
impl Send for MutationContext
impl Sync for MutationContext
impl Unpin for MutationContext
impl UnsafeUnpin for MutationContext
impl UnwindSafe for MutationContext
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> 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