[−][src]Struct rr_mux::mock::MockConnector
MockConnector provides an expectation based mock connector implementation to simplify writing tests against modules using the Connector abstraction.
Methods
impl<Addr, Req, Resp, E, Ctx> MockConnector<Addr, Req, Resp, E, Ctx> where
Addr: PartialEq + Debug + Send + 'static,
Req: PartialEq + Debug + Send + 'static,
Resp: PartialEq + Debug + Send + 'static,
E: PartialEq + Debug + Send + 'static,
Ctx: Clone + PartialEq + Debug + Send + 'static,
[src]
Addr: PartialEq + Debug + Send + 'static,
Req: PartialEq + Debug + Send + 'static,
Resp: PartialEq + Debug + Send + 'static,
E: PartialEq + Debug + Send + 'static,
Ctx: Clone + PartialEq + Debug + Send + 'static,
pub fn new() -> MockConnector<Addr, Req, Resp, E, Ctx>
[src]
Create a new mock connector
pub fn expect<T>(&mut self, transactions: T) -> Self where
T: Into<VecDeque<MockTransaction<Addr, Req, Resp, Ctx, E>>>,
[src]
T: Into<VecDeque<MockTransaction<Addr, Req, Resp, Ctx, E>>>,
Set expectations on the connector
pub fn finalise(&mut self)
[src]
Finalise expectations on the connector
Trait Implementations
impl<Addr, Req, Resp, E, Ctx> Clone for MockConnector<Addr, Req, Resp, E, Ctx>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Id, Addr, Req, Resp, E, Ctx> Connector<Id, Addr, Req, Resp, E, Ctx> for MockConnector<Addr, Req, Resp, E, Ctx> where
Id: PartialEq + Debug + Send + 'static,
Addr: PartialEq + Debug + Send + 'static,
Req: PartialEq + Debug + Send + 'static,
Resp: PartialEq + Debug + Send + 'static,
E: PartialEq + Debug + Send + 'static,
Ctx: Clone + PartialEq + Debug + Send + 'static,
[src]
Id: PartialEq + Debug + Send + 'static,
Addr: PartialEq + Debug + Send + 'static,
Req: PartialEq + Debug + Send + 'static,
Resp: PartialEq + Debug + Send + 'static,
E: PartialEq + Debug + Send + 'static,
Ctx: Clone + PartialEq + Debug + Send + 'static,
fn request<'life0, 'async_trait>(
&'life0 mut self,
ctx: Ctx,
_id: Id,
addr: Addr,
req: Req
) -> Pin<Box<dyn Future<Output = Result<Resp, E>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
ctx: Ctx,
_id: Id,
addr: Addr,
req: Req
) -> Pin<Box<dyn Future<Output = Result<Resp, E>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Make a request and return the pre-set response This checks the request against the specified expectations
fn respond<'life0, 'async_trait>(
&'life0 mut self,
ctx: Ctx,
_id: Id,
addr: Addr,
resp: Resp
) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
ctx: Ctx,
_id: Id,
addr: Addr,
resp: Resp
) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Make a response This checks the response against provided expectations
Auto Trait Implementations
impl<Addr, Req, Resp, E, Ctx> RefUnwindSafe for MockConnector<Addr, Req, Resp, E, Ctx> where
Ctx: RefUnwindSafe,
Ctx: RefUnwindSafe,
impl<Addr, Req, Resp, E, Ctx> Send for MockConnector<Addr, Req, Resp, E, Ctx> where
Addr: Send,
Ctx: Send,
E: Send,
Req: Send,
Resp: Send,
Addr: Send,
Ctx: Send,
E: Send,
Req: Send,
Resp: Send,
impl<Addr, Req, Resp, E, Ctx> Sync for MockConnector<Addr, Req, Resp, E, Ctx> where
Addr: Send,
Ctx: Send + Sync,
E: Send,
Req: Send,
Resp: Send,
Addr: Send,
Ctx: Send + Sync,
E: Send,
Req: Send,
Resp: Send,
impl<Addr, Req, Resp, E, Ctx> Unpin for MockConnector<Addr, Req, Resp, E, Ctx> where
Ctx: Unpin,
Ctx: Unpin,
impl<Addr, Req, Resp, E, Ctx> UnwindSafe for MockConnector<Addr, Req, Resp, E, Ctx> where
Ctx: UnwindSafe,
Ctx: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,