#[repr(C)]pub struct Buffer {
pub ptr: *mut u8,
pub len: usize,
pub cap: usize,
}Fields§
§ptr: *mut u8§len: usize§cap: usizeImplementations§
Source§impl Buffer
impl Buffer
pub fn null() -> Self
Sourcepub fn read(&self) -> Option<&[u8]>
pub fn read(&self) -> Option<&[u8]>
read provides a reference to the included data to be parsed or copied elsewhere data is only guaranteed to live as long as the Buffer (or the scope of the extern “C” call it came from)
Sourcepub fn read_mut(&mut self) -> Option<&mut [u8]>
pub fn read_mut(&mut self) -> Option<&mut [u8]>
read_mut provides a reference to the included data to be parsed or copied elsewhere data is only guaranteed to live as long as the Buffer (or the scope of the extern “C” call it came from)
Sourcepub fn from_vec_mut(v: &mut Vec<u8>) -> Self
pub fn from_vec_mut(v: &mut Vec<u8>) -> Self
this share our memory to the caller
Trait Implementations§
impl Copy for Buffer
Auto Trait Implementations§
impl Freeze for Buffer
impl RefUnwindSafe for Buffer
impl !Send for Buffer
impl !Sync for Buffer
impl Unpin for Buffer
impl UnwindSafe for Buffer
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