Skip to main content

fill_bytes_via_next_word

Function fill_bytes_via_next_word 

Source
pub fn fill_bytes_via_next_word<E, W: Word>(
    dst: &mut [u8],
    next_word: impl FnMut() -> Result<W, E>,
) -> Result<(), E>
Expand description

Fill dst with bytes using next_word

This may be used to implement fill_bytes over next_u32 or next_u64. Words are used in order of generation. The last word may be partially discarded.