pub struct ServiceJig<S: Service> {
pub mailbox: Mailbox<S>,
/* private fields */
}
Expand description
The ServiceJig allows you to create a mailbox for a service and control when messages will be processed. It does not use thread and is specifically well suited for unit tests.
Fields§
§mailbox: Mailbox<S>
Implementations§
Source§impl<S: Service> ServiceJig<S>
impl<S: Service> ServiceJig<S>
pub fn prepare(service: S) -> Self
Sourcepub fn process_all(&mut self)
pub fn process_all(&mut self)
Process all waiting messages
pub fn get_service(&self) -> &S
pub fn get_service_mut(&mut self) -> &mut S
Auto Trait Implementations§
impl<S> Freeze for ServiceJig<S>where
S: Freeze,
impl<S> RefUnwindSafe for ServiceJig<S>where
S: RefUnwindSafe,
impl<S> Send for ServiceJig<S>where
S: Send,
impl<S> !Sync for ServiceJig<S>
impl<S> Unpin for ServiceJig<S>where
S: Unpin,
impl<S> UnwindSafe for ServiceJig<S>where
S: UnwindSafe,
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