pub struct StringContains<'a> { /* private fields */ }
Expand description
Matches on any message containing a given string.
§Example: Matching Any Message Content
use ws_mock::matchers::{Matcher, StringContains};
let matcher = StringContains::new("data");
let matching_message = "anything with data in it";
let non_matching_message = "anything but 'd-a-t-a'";
assert!(matcher.matches(matching_message));
assert!(!matcher.matches(non_matching_message));
Implementations§
Trait Implementations§
source§impl<'a> Debug for StringContains<'a>
impl<'a> Debug for StringContains<'a>
Auto Trait Implementations§
impl<'a> Freeze for StringContains<'a>
impl<'a> RefUnwindSafe for StringContains<'a>
impl<'a> Send for StringContains<'a>
impl<'a> Sync for StringContains<'a>
impl<'a> Unpin for StringContains<'a>
impl<'a> UnwindSafe for StringContains<'a>
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