Skip to main content

ExpectMsg

Struct ExpectMsg 

Source
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: String

Expected 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: bool

T136/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

Source

pub fn of(msg_type: &str) -> Self

Expect a message of msg_type with no specific field requirements.

Source

pub fn field(self, tag: u32, value: &str) -> Self

Require a field value.

Source

pub fn without_field(self, tag: u32) -> Self

Require a tag to be entirely absent from the message.

Source

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§

Source§

impl Clone for ExpectMsg

Source§

fn clone(&self) -> ExpectMsg

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExpectMsg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more