pub struct RecordingDelivery { /* private fields */ }Expand description
A NotificationDelivery for tests: records every request it is handed and answers from a
script.
Answers Delivered once the script runs out, so RecordingDelivery::new() delivers everything and
RecordingDelivery::answering(vec![Retry(..), Retry(..), Delivered]) fails twice first.
Implementations§
Source§impl RecordingDelivery
impl RecordingDelivery
Sourcepub fn answering(outcomes: Vec<DeliveryOutcome>) -> Self
pub fn answering(outcomes: Vec<DeliveryOutcome>) -> Self
A delivery that answers outcomes in turn, then Delivered.
Sourcepub fn always(outcome: DeliveryOutcome) -> Self
pub fn always(outcome: DeliveryOutcome) -> Self
A delivery that answers outcome to every request.
Sourcepub fn named(self, consumer: impl Into<String>) -> Self
pub fn named(self, consumer: impl Into<String>) -> Self
Claim requests under consumer instead of the default name.
Sourcepub fn received(&self) -> Vec<PendingNotification>
pub fn received(&self) -> Vec<PendingNotification>
Every request handed to the delivery so far, in order, redeliveries included.
Trait Implementations§
Source§impl Clone for RecordingDelivery
impl Clone for RecordingDelivery
Source§impl Default for RecordingDelivery
impl Default for RecordingDelivery
Source§impl NotificationDelivery for RecordingDelivery
impl NotificationDelivery for RecordingDelivery
Source§fn consumer(&self) -> &str
fn consumer(&self) -> &str
The name this delivery claims requests under in the inbox. Two deliveries that must each
handle every request (a mail module and an audit mirror) name themselves apart; a single
delivery keeps the default.
Source§fn deliver<'life0, 'life1, 'async_trait>(
&'life0 self,
notification: &'life1 PendingNotification,
) -> Pin<Box<dyn Future<Output = DeliveryOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn deliver<'life0, 'life1, 'async_trait>(
&'life0 self,
notification: &'life1 PendingNotification,
) -> Pin<Box<dyn Future<Output = DeliveryOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Perform
notification.Auto Trait Implementations§
impl Freeze for RecordingDelivery
impl RefUnwindSafe for RecordingDelivery
impl Send for RecordingDelivery
impl Sync for RecordingDelivery
impl Unpin for RecordingDelivery
impl UnsafeUnpin for RecordingDelivery
impl UnwindSafe for RecordingDelivery
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
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> 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> ⓘ
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 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> ⓘ
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