Struct isotest::IsoTestApi
source · [−]pub struct IsoTestApi<A: Iso>(_);
Expand description
The API passed into an isotest in the Test context.
The isotest!
macro is a bit sneaky, passing in APIs with different
function signatures for each context, so that the test can be written
the same lexically, but actually expand to two different tests
working with two different types.
Implementations
sourceimpl<A: Iso> IsoTestApi<A>
impl<A: Iso> IsoTestApi<A>
sourcepub fn update(&self, a: A, f: impl Fn(A) -> A) -> A
pub fn update(&self, a: A, f: impl Fn(A) -> A) -> A
Update test data with a function over test data (simple map)
sourcepub fn mutate(&self, a: &mut A, f: impl Fn(&mut A))
pub fn mutate(&self, a: &mut A, f: impl Fn(&mut A))
Mutate test data with a function over test data (simple mutable map)
sourcepub fn context(&self) -> IsotestContext
pub fn context(&self) -> IsotestContext
Return the context we’re in
Auto Trait Implementations
impl<A> RefUnwindSafe for IsoTestApi<A>where
A: RefUnwindSafe,
impl<A> Send for IsoTestApi<A>where
A: Send,
impl<A> Sync for IsoTestApi<A>where
A: Sync,
impl<A> Unpin for IsoTestApi<A>where
A: Unpin,
impl<A> UnwindSafe for IsoTestApi<A>where
A: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more