Struct unimock::build::QuantifyReturnValue
source · pub struct QuantifyReturnValue<'p, F, T, O>where
F: MockFn,
T: IntoResponseOnce<F::Response>,{ /* private fields */ }
Expand description
Builder for defining how a call pattern with an explicit return value gets verified with regards to quantification/counting.
Implementations§
source§impl<'p, F, T, O> QuantifyReturnValue<'p, F, T, O>where
F: MockFn,
T: IntoResponseOnce<F::Response>,
O: Copy,
impl<'p, F, T, O> QuantifyReturnValue<'p, F, T, O>where
F: MockFn,
T: IntoResponseOnce<F::Response>,
O: Copy,
sourcepub fn once(self) -> QuantifiedResponse<'p, F, O, Exact>
pub fn once(self) -> QuantifiedResponse<'p, F, O, Exact>
Expect this call pattern to be called exactly once.
This is the only quantifier that works together with return values that don’t implement Clone.
sourcepub fn n_times(self, times: usize) -> QuantifiedResponse<'p, F, O, Exact>where
T: IntoResponseClone<F::Response>,
pub fn n_times(self, times: usize) -> QuantifiedResponse<'p, F, O, Exact>where
T: IntoResponseClone<F::Response>,
Expect this call pattern to be called exactly the specified number of times.
sourcepub fn at_least_times(
self,
times: usize
) -> QuantifiedResponse<'p, F, O, AtLeast>where
T: IntoResponseClone<F::Response>,
pub fn at_least_times(
self,
times: usize
) -> QuantifiedResponse<'p, F, O, AtLeast>where
T: IntoResponseClone<F::Response>,
Expect this call pattern to be called at least the specified number of times.
Trait Implementations§
source§impl<'p, F, T, O> Drop for QuantifyReturnValue<'p, F, T, O>where
F: MockFn,
T: IntoResponseOnce<F::Response>,
impl<'p, F, T, O> Drop for QuantifyReturnValue<'p, F, T, O>where
F: MockFn,
T: IntoResponseOnce<F::Response>,
The drop implementation of this is intended to run when used in a stubbing clause, when the call pattern is left unquantified by the user.
In that case, it is only able to return once, because no Clone bound has been part of any construction step.