[−][src]Trait smart_access::BatchCt
A compile-time batch. Requires batch_ct
feature.
See basic usage guide here.
Allows one to write batch transformers without specifying complex return types.
use smart_access::{ BatchCt, Cps }; fn add_inc<T>(batch: impl BatchCt<i32, T>) -> impl BatchCt<i32, ()> { batch.add(|x, _| { *x = *x + 1; }) } let mut foo = 1; add_inc(add_inc(foo.batch_ct())).run(); assert!(foo == 3);
Associated Types
Loading content...Required methods
fn add<G, S>(self, g: G) -> CpsBatch<Self::CPS, (Self::List, G)> where
G: FnOnce(&mut V, R) -> S,
G: FnOnce(&mut V, R) -> S,
Adds a new function to a compile-time batch.
fn clear(self) -> CpsBatch<Self::CPS, ()>
Clears a compile-time batch.
Provided methods
Loading content...Implementors
impl<CPS, Prev, F, R> BatchCt<<CPS as Cps>::View, R> for CpsBatch<CPS, (Prev, F)> where
CPS: Cps,
(Prev, F): RunBatch<CPS::View, Output = R>,
[src]
CPS: Cps,
(Prev, F): RunBatch<CPS::View, Output = R>,
type CPS = CPS
type List = (Prev, F)
fn add<G, S>(self, g: G) -> CpsBatch<CPS, (Self::List, G)> where
G: FnOnce(&mut CPS::View, R) -> S,
[src]
G: FnOnce(&mut CPS::View, R) -> S,