pub fn read(&mut self) -> Option<[u8; N]> {
        if !self.is_reserve_full {
            // For the sake of simplicity to begin with, return None
            // if the reserve buffer is not ready
            return Option::None;
        }

        // Get ther reserve buffer
        let reserve = if self.active_toggle {
            &self.buffer_b
        } else {
            &self.buffer_a
        };

        // Copy the data from the internal buffer for returning
        // This allows the data to be safely & immediately overwritten
        let mut data: [u8; N] = [0; N];
        data.copy_from_slice(reserve);

        // After we have copied the bytes, then they can be cleared out allowing
        // The reserve buffer to become to active buffer
        self.is_reserve_full = false;

        return Option::Some(data);
    }
/// Read the data from the reserve buffer.
/// If the reserve buffer is not yet full, this function will return Option::None
/// Once the bytes are read from, this will allow the reserve buffer to be toggled into
/// the active buffer
Read the data from the reserve buffer.
If the reserve buffer is not yet full, this function will return Option::None
Once the bytes are read from, this will allow the reserve buffer to be toggled into
the active buffer
Read the data from the reserve buffer . If the reserve buffer is not yet full this function will return Option :: None Once the bytes are read from this will allow the reserve buffer to be toggled into the active buffer
pub fn read(&mut self) -> Option<[u8; N]> {
        if !self.is_reserve_full {
            // For the sake of simplicity to begin with, return None
            // if the reserve buffer is not ready
            return Option::None;
        }
        // Get ther reserve buffer
        let reserve = if self.active_toggle {
            &self.buffer_b
        } else {
            &self.buffer_a
        };
        // Copy the data from the internal buffer for returning
        // This allows the data to be safely & immediately overwritten
        let mut data: [u8; N] = [0; N];
        data.copy_from_slice(reserve);
        // After we have copied the bytes, then they can be cleared out allowing
        // The reserve buffer to become to active buffer
        self.is_reserve_full = false;
        return Option::Some(data);
    }
pub fn read ( & mut self ) -> Option < [ u8 ; N ] > { if ! self . is_reserve_full { // For the sake of simplicity to begin with, return None // if the reserve buffer is not ready return Option :: None ; } // Get ther reserve buffer let reserve = if self . active_toggle { & self . buffer_b } else { & self . buffer_a } ; // Copy the data from the internal buffer for returning // This allows the data to be safely & immediately overwritten let mut data : [ u8 ; N ] = [ 0 ; N ] ; data . copy_from_slice ( reserve ) ; // After we have copied the bytes, then they can be cleared out allowing // The reserve buffer to become to active buffer self . is_reserve_full = false ; return Option :: Some ( data ) ; }
Read the data from the reserve buffer.
Read the data from the reserve buffer .
&mut self
&mut self