pub struct Transition<State, Effect> { /* private fields */ }Expand description
English: Exposes core 0.4’s domain, persistence, and event-workflow API.
日本語: コア 0.4 のドメイン、永続化、イベント処理 API を公開します。 English: Exposes process transition computation and owned state/effect results.
日本語: プロセスの遷移計算と、所有された状態・副作用の結果を公開します。
English: Owned next state and ordered effect descriptions returned by a ProcessManager.
Construction and access do not execute effects or persist the state. Empty effects are valid;
callers choose how to coordinate state storage and effect execution.
日本語: ProcessManager が返す、所有された次状態と順序付きの副作用の記述です。
構築や参照で副作用を実行したり状態を永続化したりしません。空の副作用列も許容し、
状態保存と副作用実行の連携方法は呼び出し側が決めます。
English: Inspect the transition before taking ownership of both components.
日本語: 遷移を参照してから、両方の構成要素の所有権を取り出します。
use ddd_toolkit_core::Transition;
let transition = Transition::new("paid", vec!["send receipt"]);
assert_eq!(transition.state(), &"paid");
assert_eq!(transition.effects(), &["send receipt"]);
let (state, effects) = transition.into_parts();
assert_eq!((state, effects), ("paid", vec!["send receipt"]));Implementations§
Source§impl<State, Effect> Transition<State, Effect>
impl<State, Effect> Transition<State, Effect>
Sourcepub fn new(state: State, effects: Vec<Effect>) -> Transition<State, Effect>
pub fn new(state: State, effects: Vec<Effect>) -> Transition<State, Effect>
English: Stores state and effects unchanged, preserving the vector’s order without validation.
日本語: 検証せず、ベクターの順序を保ったまま state と effects を保持します。
Sourcepub fn state(&self) -> &State
pub fn state(&self) -> &State
English: Borrows the next state without applying it to any external store.
日本語: 外部ストアへの反映を行わず、次状態を借用します。
Sourcepub fn effects(&self) -> &[Effect]
pub fn effects(&self) -> &[Effect]
English: Borrows the effect descriptions in their stored order without executing them.
日本語: 実行せず、保持している順序で副作用の記述を借用します。
Sourcepub fn into_parts(self) -> (State, Vec<Effect>)
pub fn into_parts(self) -> (State, Vec<Effect>)
English: Consumes the transition to return its state and effect vector without cloning.
日本語: 遷移を消費し、複製せずに状態と副作用のベクターを返します。