pub struct ByteBuffer { /* private fields */ }
Implementations§
Source§impl ByteBuffer
impl ByteBuffer
pub fn new() -> Self
pub fn push_byte(&mut self, byte: u8)
pub fn push_string(&mut self, string: String)
pub fn push_u32_shrunk(&mut self, num: u32)
pub fn push_byte_buffer(&mut self, other: &ByteBuffer)
Sourcepub fn pad_left(&mut self, size: usize)
pub fn pad_left(&mut self, size: usize)
Moves the byte buffer to the left by the specified [size]
Sourcepub fn pad_right(&mut self, size: usize)
pub fn pad_right(&mut self, size: usize)
Moves the byte buffer to the right by the specified [size]
pub fn as_usize_unsafe(&self) -> usize
Sourcepub fn to_vec(&self) -> Vec<u8> ⓘ
pub fn to_vec(&self) -> Vec<u8> ⓘ
Clones inner representation of the byte buffer and returns Vec
pub fn to_string(&self) -> Result<String, FromUtf8Error>
Trait Implementations§
Source§impl Clone for ByteBuffer
impl Clone for ByteBuffer
Source§fn clone(&self) -> ByteBuffer
fn clone(&self) -> ByteBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ByteBuffer
impl Debug for ByteBuffer
Auto Trait Implementations§
impl Freeze for ByteBuffer
impl RefUnwindSafe for ByteBuffer
impl Send for ByteBuffer
impl Sync for ByteBuffer
impl Unpin for ByteBuffer
impl UnwindSafe for ByteBuffer
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