pub fn first(&self) -> Option<&T> {
        if self.is_empty(){
            None
        } else {
            Some(&* self.buffer[self.internal_index(0)])
        }
    }
/**
    Returns a reference to the first element of the buffer.

    Returns `None` if the buffer is empty.

    # Example

    ```
    use advanced_collections::circular_buffer::CircularBuffer;

    fn main(){
       let mut cb = CircularBuffer::from(vec![1,2,3]);
       assert_eq!(cb.first(), Some(&1));
    }
    ```
    */
Returns a reference to the first element of the buffer.
Returns `None` if the buffer is empty.
Returns a reference to the first element of the buffer . Returns ` None ` if the buffer is empty .
pub fn first(&self) -> Option<&T> {
        if self.is_empty(){
            None
        } else {
            Some(&* self.buffer[self.internal_index(0)])
        }
    }
pub fn first ( & self ) -> Option < & T > { if self . is_empty ( ) { None } else { Some ( & * self . buffer [ self . internal_index ( 0 ) ] ) } }
Returns a reference to the first element of the buffer.
Returns a reference to the first element of the buffer .
&self
&self
example
```
use advanced_collections::circular_buffer::CircularBuffer.


` ` ` use advanced_collections :: circular_buffer :: CircularBuffer .