Struct mockers::CallMatchSend3

source ·
pub struct CallMatchSend3<Arg0, Arg1, Arg2, Res> { /* private fields */ }
Expand description

Call matcher for methods of Sendable mock. The difference is that argument matchers must also implement Send.

Implementations§

source§

impl<Arg0, Arg1, Arg2, Res> CallMatchSend3<Arg0, Arg1, Arg2, Res>

source

pub fn new( mock_id: usize, mock_type_id: usize, method_name: &'static str, type_param_ids: Vec<usize>, arg0: Box<dyn MatchArg<Arg0> + Send>, arg1: Box<dyn MatchArg<Arg1> + Send>, arg2: Box<dyn MatchArg<Arg2> + Send> ) -> Self

source§

impl<Arg0: 'static, Arg1: 'static, Arg2: 'static, Res: Send + 'static> CallMatchSend3<Arg0, Arg1, Arg2, Res>

source

pub fn and_return( self, result: Res ) -> ExpectationSend3<Arg0, Arg1, Arg2, Res, impl FnOnce(Arg0, Arg1, Arg2) -> Res>

source

pub fn and_panic( self, msg: String ) -> ExpectationSend3<Arg0, Arg1, Arg2, Res, impl FnOnce(Arg0, Arg1, Arg2) -> Res>

source

pub fn and_call<F>( self, func: F ) -> ExpectationSend3<Arg0, Arg1, Arg2, Res, impl FnOnce(Arg0, Arg1, Arg2) -> Res>
where F: FnOnce(Arg0, Arg1, Arg2) -> Res + Send + 'static,

source

pub fn never(self) -> ExpectationNever<Self>

Trait Implementations§

source§

impl<Arg0, Arg1, Arg2, Res> CallMatch for CallMatchSend3<Arg0, Arg1, Arg2, Res>

source§

fn matches_args(&self, call: &Call) -> bool

source§

fn validate(&self, call: &Call) -> Vec<Result<(), String>>

source§

fn get_mock_id(&self) -> usize

source§

fn get_mock_type_id(&self) -> usize

source§

fn get_method_name(&self) -> &'static str

source§

fn get_type_param_ids(&self) -> &[usize]

source§

fn describe(&self) -> String

source§

fn matches(&self, call: &Call) -> bool

source§

fn matches_target(&self, call: &Call) -> bool

source§

fn matches_generic_method(&self, call: &Call) -> bool

source§

fn matches_method(&self, call: &Call) -> bool

Auto Trait Implementations§

§

impl<Arg0, Arg1, Arg2, Res> !RefUnwindSafe for CallMatchSend3<Arg0, Arg1, Arg2, Res>

§

impl<Arg0, Arg1, Arg2, Res> Send for CallMatchSend3<Arg0, Arg1, Arg2, Res>
where Res: Send,

§

impl<Arg0, Arg1, Arg2, Res> !Sync for CallMatchSend3<Arg0, Arg1, Arg2, Res>

§

impl<Arg0, Arg1, Arg2, Res> Unpin for CallMatchSend3<Arg0, Arg1, Arg2, Res>
where Res: Unpin,

§

impl<Arg0, Arg1, Arg2, Res> !UnwindSafe for CallMatchSend3<Arg0, Arg1, Arg2, Res>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.