pub struct CircularBuffer<T = u8> { /* private fields */ }Implementations§
Source§impl<T: Default + Copy> CircularBuffer<T>
impl<T: Default + Copy> CircularBuffer<T>
pub fn new(capacity: usize) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn capacity(&self) -> usize
pub fn available(&self) -> usize
pub fn grow(&mut self, capacity: usize) -> Result<()>
pub fn write(&mut self, buf: &[T]) -> Result<usize>
pub fn read(&mut self, buf: &mut [T]) -> Result<usize>
pub fn peek(&self, buf: &mut [T]) -> Result<usize>
pub fn consume(&mut self, len: usize) -> usize
pub fn clear(&mut self)
Auto Trait Implementations§
impl<T> Freeze for CircularBuffer<T>
impl<T> RefUnwindSafe for CircularBuffer<T>where
T: RefUnwindSafe,
impl<T> Send for CircularBuffer<T>where
T: Send,
impl<T> Sync for CircularBuffer<T>where
T: Sync,
impl<T> Unpin for CircularBuffer<T>where
T: Unpin,
impl<T> UnwindSafe for CircularBuffer<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more