pub struct Scenario {
pub name: String,
pub steps: Vec<SimStep>,
}Expand description
A serializable simulation script — a deterministic, model-free test case that can be authored in code or loaded from YAML/JSON.
Fields§
§name: StringScenario name (for diagnostics).
steps: Vec<SimStep>The steps to execute, in order.
Implementations§
Source§impl Scenario
impl Scenario
Sourcepub async fn run(
&self,
convo: &CompiledConversation,
mode: Enforcement,
) -> Result<(), String>
pub async fn run( &self, convo: &CompiledConversation, mode: Enforcement, ) -> Result<(), String>
Run the scenario against convo. Returns Ok(()) if every Expect* step
holds, else Err with the failing step index and a diagnostic.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scenario
impl<'de> Deserialize<'de> for Scenario
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Scenario
impl RefUnwindSafe for Scenario
impl Send for Scenario
impl Sync for Scenario
impl Unpin for Scenario
impl UnwindSafe for Scenario
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