pub struct PhasePreparation {
pub name: String,
pub produces: Vec<String>,
pub run: Arc<dyn Fn(State, Arc<dyn SessionWriter>) -> BoxFuture<()> + Send + Sync>,
}Expand description
A preparation effect that can materialize state before a phase is entered.
Preparations run after an outbound transition guard selects a target phase but before the machine commits to entering that target. They are intended for authoritative preconditions such as loading records, retrieving catalog facts, fetching policy, or hydrating state from durable storage.
Fields§
§name: StringStable name for diagnostics.
produces: Vec<String>State keys this preparation is expected to produce.
run: Arc<dyn Fn(State, Arc<dyn SessionWriter>) -> BoxFuture<()> + Send + Sync>Async effect that can mutate state and/or write context.
Auto Trait Implementations§
impl Freeze for PhasePreparation
impl !RefUnwindSafe for PhasePreparation
impl Send for PhasePreparation
impl Sync for PhasePreparation
impl Unpin for PhasePreparation
impl !UnwindSafe for PhasePreparation
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