Struct mockers::CallMatchSend0

source ·
pub struct CallMatchSend0<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<Res> CallMatchSend0<Res>

source

pub fn new( mock_id: usize, mock_type_id: usize, method_name: &'static str, type_param_ids: Vec<usize> ) -> Self

source§

impl<Res: Send + 'static> CallMatchSend0<Res>

source

pub fn and_return( self, result: Res ) -> ExpectationSend0<Res, impl FnOnce() -> Res>

source

pub fn and_panic( self, msg: String ) -> ExpectationSend0<Res, impl FnOnce() -> Res>

source

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

source

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

Trait Implementations§

source§

impl<Res> CallMatch for CallMatchSend0<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<Res> RefUnwindSafe for CallMatchSend0<Res>
where Res: RefUnwindSafe,

§

impl<Res> Send for CallMatchSend0<Res>
where Res: Send,

§

impl<Res> Sync for CallMatchSend0<Res>
where Res: Sync,

§

impl<Res> Unpin for CallMatchSend0<Res>
where Res: Unpin,

§

impl<Res> UnwindSafe for CallMatchSend0<Res>
where Res: UnwindSafe,

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.