Skip to main content

appended

Function appended 

Source
pub unsafe fn appended<B, T>(
    out: &mut Vec<B>,
    n: usize,
    write: impl FnOnce(&mut [MaybeUninit<B>]) -> T,
) -> T
Expand description

Appends n items to out, which write writes into its spare capacity, never zeroed first, and gives write’s result. write must write every slot it gets. Each caller’s loop does, by its construction.

§Safety

write must initialize every slot it receives before returning.