#[non_exhaustive]pub enum ScenarioAction {
Send {
to: EndpointRef,
body: Option<Value>,
headers: Option<BTreeMap<String, Value>>,
method: String,
expect_reply: Option<Expectation>,
},
Receive {
from: EndpointRef,
deadline: Duration,
extract: Option<BTreeMap<String, String>>,
},
Sleep {
duration: Duration,
},
Validate {
target: ScenarioTarget,
expectation: ValidateExpectation,
deadline: Option<Duration>,
elapsed_at_least: Option<Duration>,
},
Sql {
datasource: String,
prepare: Vec<String>,
},
}Expand description
One ordered scenario action (ADR-0069 section 11, adopted from
Citrus: send, receive with a mandatory deadline, sleep,
validate, sql).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Send
Send a message to an endpoint.
Fields
to: EndpointRefTarget endpoint reference.
expect_reply: Option<Expectation>Reply assertion for direct: sends (rc-qvz6): the same
matcher grammar validate parses, evaluated against the
synchronous route reply the context-stimulus adapter
returns. Load-time rejected on every other scheme.
Receive
Receive a message from an endpoint before the deadline passes.
Fields
from: EndpointRefSource endpoint reference.
Sleep
Pause the scenario for the given duration.
Validate
Assert an expectation against a scenario target.
Fields
target: ScenarioTargetWhat to validate: the last message received on an endpoint, a scenario variable, a partner’s recorded traffic, or a datasource read.
expectation: ValidateExpectationMatcher expectation: the message grammar for lastReceived
and variable targets, the partner count grammar for
partner targets, the sql row grammar for sql targets.
deadline: Option<Duration>Optional poll deadline. Only valid on partner and sql
targets, whose assertions settle asynchronously or read a
live datasource; without it the partner assertion reads one
immediate snapshot.
elapsed_at_least: Option<Duration>Optional minimum wire-arrival age. Only valid on
lastReceived targets: the last received message must have
arrived at least this long after the scenario started (the
not-before-X control run.sh expresses with awk). The
assertion anchors to the message’s wire arrival, never the
consumption time.
Sql
Seed datasource state before the route assertions run (bd
rc-25lup.1): execute the ordered prepare mutation statements
against the named datasource’s pool through the scenario sql:
vocabulary. Reads are rejected at load (is_read_statement):
the validate sql target owns reads, and the two vocabularies
never mix. Activation is demand-gated behind the harness sql
feature (the inbound:/http precedent, ADR-0069 §8); the
grammar and validation run in every build.
Trait Implementations§
Source§impl Clone for ScenarioAction
impl Clone for ScenarioAction
Source§fn clone(&self) -> ScenarioAction
fn clone(&self) -> ScenarioAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ScenarioAction
impl RefUnwindSafe for ScenarioAction
impl Send for ScenarioAction
impl Sync for ScenarioAction
impl Unpin for ScenarioAction
impl UnsafeUnpin for ScenarioAction
impl UnwindSafe for ScenarioAction
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request