pub struct UpdatePlan { /* private fields */ }Expand description
Write plan for an update op (entity or note shape — ADR-099 D3’s
update caveat covers both substrates the same way: row/FTS DML in the
plan, any reindex deferred to post_commit).
Deferred effects are assigned by this crate’s prepare pass and cannot be supplied by callers constructing a plan directly:
ⓘ
use khive_runtime::{PostCommitEffect, UpdatePlan};
use uuid::Uuid;
let id = Uuid::nil();
let plan = UpdatePlan {
target_id: id,
statements: Vec::new(),
post_commit: PostCommitEffect::ReindexEntity { entity_id: id },
edge_natural_key: None,
idempotent_noop: false,
};A plan returned by a prepare function cannot have its validated statements cleared or replaced before it reaches the runner:
ⓘ
use khive_runtime::UpdatePlan;
fn clear_prepared_statements(mut prepared: UpdatePlan) {
prepared.statements.clear();
}Implementations§
Source§impl UpdatePlan
impl UpdatePlan
Sourcepub fn edge_natural_key(&self) -> Option<&EdgeNaturalKey>
pub fn edge_natural_key(&self) -> Option<&EdgeNaturalKey>
The committed lookup key required for a symmetric edge update.
Sourcepub fn post_commit(&self) -> &PostCommitEffect
pub fn post_commit(&self) -> &PostCommitEffect
The potential deferred effect. The writer resolves inherited embedding membership before issuing the committed-effects token.
Sourcepub fn is_idempotent_noop(&self) -> bool
pub fn is_idempotent_noop(&self) -> bool
Whether this plan is a mutation-free note update assertion.
Trait Implementations§
Source§impl Clone for UpdatePlan
impl Clone for UpdatePlan
Auto Trait Implementations§
impl Freeze for UpdatePlan
impl RefUnwindSafe for UpdatePlan
impl Send for UpdatePlan
impl Sync for UpdatePlan
impl Unpin for UpdatePlan
impl UnsafeUnpin for UpdatePlan
impl UnwindSafe for UpdatePlan
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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