pub struct EventSequence { /* private fields */ }
Implementations§
Source§impl EventSequence
impl EventSequence
pub fn new() -> Self
pub fn then(self, matcher: EventMatcher) -> Self
Sourcepub fn all_of(self, events: Vec<EventMatcher>, ordering: Ordering) -> Self
pub fn all_of(self, events: Vec<EventMatcher>, ordering: Ordering) -> Self
Adds a group of matchers to verify all following events in the sequence match with the given ordering.
The sequence will fail to match if contains events that don’t match the group.
Sourcepub fn has_subset(self, events: Vec<EventMatcher>, ordering: Ordering) -> Self
pub fn has_subset(self, events: Vec<EventMatcher>, ordering: Ordering) -> Self
Adds a group of matchers to verify that the sequence contains a subset of events that match with the given ordering.
Events in the sequence that don’t match will be ignored. Subsequent matchers outside of this group will not be able to match against ignored events.
Sourcepub async fn expect(self, event_stream: EventStream) -> Result<(), Error>
pub async fn expect(self, event_stream: EventStream) -> Result<(), Error>
Verify that the events in this sequence are received from the provided EventStream.
Sourcepub async fn expect_and_giveback(
self,
event_stream: EventStream,
) -> Result<EventStream, Error>
pub async fn expect_and_giveback( self, event_stream: EventStream, ) -> Result<EventStream, Error>
Verify that the events in this sequence are received from the provided EventStream, and gives back the event stream on success.
pub fn is_empty(&self) -> bool
pub fn event_names(&self) -> Result<Vec<String>, Error>
Sourcepub fn next(&mut self, event: &EventDescriptor) -> Result<(), Error>
pub fn next(&mut self, event: &EventDescriptor) -> Result<(), Error>
Tests an EventDescriptor and against the first EventGroup.
If an EventGroup has been entirely consumed (no further EventMatchers to match against) then the EventGroup is dropped.
Returns an error if the EventSequence have not been entirely consumed, and the incoming EventDescriptor does not match the first sequence.
Returns Ok(true) if there is a positive match. Returns Ok(false) if the EventSequence is empty.
Trait Implementations§
Source§impl Clone for EventSequence
impl Clone for EventSequence
Source§fn clone(&self) -> EventSequence
fn clone(&self) -> EventSequence
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for EventSequence
impl RefUnwindSafe for EventSequence
impl Send for EventSequence
impl Sync for EventSequence
impl Unpin for EventSequence
impl UnwindSafe for EventSequence
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)