Function ringbuf::transfer

source ·
pub fn transfer<T, Rs: RbRef, Rd: RbRef>(
    src: &mut Consumer<T, Rs>,
    dst: &mut Producer<T, Rd>,
    count: Option<usize>
) -> usizewhere
    Rs::Rb: RbRead<T>,
    Rd::Rb: RbWrite<T>,
Expand description

Moves at most count items from the src consumer to the dst producer.

Consumer and producer may be of different buffers as well as of the same one. count is the number of items being moved, if None - as much as possible items will be moved.

Returns number of items been moved.