pub fn copy_cb<F: FnOnce(&mut [u8])>(&mut self, size: usize, cb: F) {
        // only write complete frames.
        let len = min(
            size / self.buffer.frame_size * self.buffer.frame_size,
            self.buffer.buffer.len() - self.buffer.offset,
        );
        cb(&mut self.buffer.buffer[self.buffer.offset..(self.buffer.offset + len)]);
        self.buffer.offset += len;
    }
/// Writes up to `size` bytes directly to this buffer inside of the given callback function.
Writes up to `size` bytes directly to this buffer inside of the given callback function.
Writes up to ` size ` bytes directly to this buffer inside of the given callback function .
pub fn copy_cb<F: FnOnce(&mut [u8])>(&mut self, size: usize, cb: F) {
        // only write complete frames.
        let len = min(
            size / self.buffer.frame_size * self.buffer.frame_size,
            self.buffer.buffer.len() - self.buffer.offset,
        );
        cb(&mut self.buffer.buffer[self.buffer.offset..(self.buffer.offset + len)]);
        self.buffer.offset += len;
    }
pub fn copy_cb < F : FnOnce ( & mut [ u8 ] ) > ( & mut self , size : usize , cb : F ) { // only write complete frames. let len = min ( size / self . buffer . frame_size * self . buffer . frame_size , self . buffer . buffer . len ( ) - self . buffer . offset , ) ; cb ( & mut self . buffer . buffer [ self . buffer . offset .. ( self . buffer . offset + len ) ] ) ; self . buffer . offset += len ; }
Writes up to `size` bytes directly to this buffer inside of the given callback function.
Writes up to ` size ` bytes directly to this buffer inside of the given callback function .
&mut self
size
usize
cb
F
&mut self
size
usize
cb
F