pub trait ByteBuffer: AsRef<[u8]> + Clone + Send {
fn len(&self) -> usize;
#[inline]
fn is_empty(&self) -> bool {
self.len() == 0
}
fn get(&self, at: usize) -> &u8;
fn slice(&self) -> &[u8];
fn slice_start(&self, start: usize) -> &[u8];
fn slice_end(&self, end: usize) -> &[u8];
fn slice_both(&self, start: usize, end: usize) -> &[u8];
fn split(&self, divide: usize) -> (&[u8], &[u8]);
}
pub trait ByteBufferMut: ByteBuffer + AsMut<[u8]> {
fn set(&self, at: usize, value: u8);
#[allow(clippy::mut_from_ref)]
fn slice_mut(&self) -> &mut [u8];
#[allow(clippy::mut_from_ref)]
fn slice_start_mut(&self, start: usize) -> &mut [u8];
#[allow(clippy::mut_from_ref)]
fn slice_end_mut(&self, end: usize) -> &mut [u8];
#[allow(clippy::mut_from_ref)]
fn slice_both_mut(&self, start: usize, end: usize) -> &mut [u8];
#[allow(clippy::mut_from_ref)]
fn split_mut(&self, divide: usize) -> (&mut [u8], &mut [u8]);
fn rebuffer_start(&self, start: usize) -> Self;
fn rebuffer_end(&self, end: usize) -> Self;
fn rebuffer_both(&self, start: usize, end: usize) -> Self;
fn expand_start(&self, size: usize) -> Self;
fn expand_end(&self, size: usize) -> Self;
fn split_buf_start(&self, divide: usize) -> (Self, Self);
fn split_buf_end(&self, divide: usize) -> (Self, Self);
fn append(&self, other: &[u8]) -> Self;
fn prepend(&self, other: &[u8]) -> Self;
fn ensure_size(&self, size: usize) -> Self;
}