pub struct Bytes { /* private fields */ }Implementations§
Source§impl Bytes
impl Bytes
pub fn try_unwrap(this: Bytes) -> Result<Window<Box<[u8]>>, Bytes>
pub fn new(bytes: Box<[u8]>) -> Bytes
pub fn slice(&self, start: usize, end: usize) -> Bytes
pub fn split_off(&mut self, at: usize) -> Bytes
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn as_slice(&self) -> Ref<'_, [u8]>
pub fn as_mut(&mut self) -> RefMut<'_, [u8]>
pub fn read_u8(&self, pos: usize) -> Result<u8>
pub fn read_u16<B: ByteOrder>(&self, pos: usize) -> Result<u16>
pub fn read_u32<B: ByteOrder>(&self, pos: usize) -> Result<u32>
pub fn read_u64<B: ByteOrder>(&self, pos: usize) -> Result<u64>
pub fn read_u128<B: ByteOrder>(&self, pos: usize) -> Result<u128>
pub fn write_u8(&mut self, pos: usize, value: u8) -> Result<()>
pub fn write_u16<B: ByteOrder>(&mut self, pos: usize, value: u16) -> Result<()>
pub fn write_u32<B: ByteOrder>(&mut self, pos: usize, value: u32) -> Result<()>
pub fn write_u64<B: ByteOrder>(&mut self, pos: usize, value: u64) -> Result<()>
pub fn write_u128<B: ByteOrder>( &mut self, pos: usize, value: u128, ) -> Result<()>
pub fn pair_iter(&self) -> PairIter
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bytes
impl !RefUnwindSafe for Bytes
impl !Send for Bytes
impl !Sync for Bytes
impl Unpin for Bytes
impl !UnwindSafe for Bytes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more