Skip to main content

buffered

Function buffered 

Source
pub unsafe fn buffered<O: Copy, P>(
    n: usize,
    out: &mut [MaybeUninit<P>],
    f: impl FnOnce(&mut [MaybeUninit<O>]) -> bool,
    each: impl Fn(O) -> P,
) -> bool
Expand description

f, a slice form writing n outputs of type O, run into a buffer, with each turning each output into the P that out takes. It gives f’s result.

§Safety

f must initialize every output slot it receives before returning.