pub fn flush(&mut self) -> ([u8; N], usize) {
        // Get the active buffer
        let buff = if self.active_toggle {
            &self.buffer_a
        } else {
            &self.buffer_b
        };

        let mut data: [u8; N] = [0; N];
        let remainder = self.active_index;
        data[0..remainder].copy_from_slice(&buff[0..remainder]);
        self.active_index = 0;
        (data, remainder)
    }
/// Read out the remainding data from the active buffer
/// Useful in circumstances in which the buffering process needs to end, and there
/// isnt enough data to toggle between the active and reserve buffers
Read out the remainding data from the active buffer
Useful in circumstances in which the buffering process needs to end, and there
isnt enough data to toggle between the active and reserve buffers
Read out the remainding data from the active buffer Useful in circumstances in which the buffering process needs to end and there isnt enough data to toggle between the active and reserve buffers
pub fn flush(&mut self) -> ([u8; N], usize) {
        // Get the active buffer
        let buff = if self.active_toggle {
            &self.buffer_a
        } else {
            &self.buffer_b
        };
        let mut data: [u8; N] = [0; N];
        let remainder = self.active_index;
        data[0..remainder].copy_from_slice(&buff[0..remainder]);
        self.active_index = 0;
        (data, remainder)
    }
pub fn flush ( & mut self ) -> ( [ u8 ; N ] , usize ) { // Get the active buffer let buff = if self . active_toggle { & self . buffer_a } else { & self . buffer_b } ; let mut data : [ u8 ; N ] = [ 0 ; N ] ; let remainder = self . active_index ; data [ 0 .. remainder ] . copy_from_slice ( & buff [ 0 .. remainder ] ) ; self . active_index = 0 ; ( data , remainder ) }
Read out the remainding data from the active buffer
Useful in circumstances in which the buffering process needs to end, and there
isnt enough data to toggle between the active and reserve buffers
Read out the remainding data from the active buffer Useful in circumstances in which the buffering process needs to end and there isnt enough data to toggle between the active and reserve buffers
&mut self
&mut self