pub struct ExpectMsg {
pub msg_type: String,
pub fields: Vec<(u32, String)>,
pub fields_absent: Vec<u32>,
pub exact: bool,
}Expand description
A message the scenario expects the server to send: a MsgType plus required field matches. Volatile fields (SendingTime, BodyLength, CheckSum) are intentionally not matched.
Fields§
§msg_type: StringExpected MsgType (tag 35).
fields: Vec<(u32, String)>(tag, value) pairs that must be present (in header or body) with the given value.
fields_absent: Vec<u32>Tags that must be absent entirely (T015, feature 007 — e.g. confirming a Logon response
does NOT echo ResetSeqNumFlag when the inbound Logon never carried it).
exact: boolT136/T137 (feature 009, NEW-50): when set, check_match additionally fails if the actual
message carries any tag beyond fields and ALWAYS_ALLOWED_TAGS — i.e. an unexpected
extra field. Opt-in (default false, via ExpectMsg::exact) rather than the default for
every ExpectMsg: most of this suite’s ~90 existing scenarios only assert the handful of
fields they actually care about, deliberately leaving every other legitimate field (e.g. a
Logon response’s own EncryptMethod/HeartBtInt) unlisted — checking exhaustively by
default would require rewriting all of them, not just this one item’s fix.
Implementations§
Source§impl ExpectMsg
impl ExpectMsg
Sourcepub fn of(msg_type: &str) -> Self
pub fn of(msg_type: &str) -> Self
Expect a message of msg_type with no specific field requirements.
Sourcepub fn without_field(self, tag: u32) -> Self
pub fn without_field(self, tag: u32) -> Self
Require a tag to be entirely absent from the message.
Sourcepub fn exact(self) -> Self
pub fn exact(self) -> Self
Additionally fail if the actual message carries any tag beyond the ones already required
via ExpectMsg::field and ALWAYS_ALLOWED_TAGS (T136/T137, NEW-50).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExpectMsg
impl RefUnwindSafe for ExpectMsg
impl Send for ExpectMsg
impl Sync for ExpectMsg
impl Unpin for ExpectMsg
impl UnsafeUnpin for ExpectMsg
impl UnwindSafe for ExpectMsg
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
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> ⓘ
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 more