pub struct SimpleBuffer { /* private fields */ }
Expand description
A simple buffer to use for transferring bytes between compartments, using shared memory via objects underneath.
Implementations§
Source§impl SimpleBuffer
impl SimpleBuffer
Sourcepub fn new(handle: ObjectHandle) -> Self
pub fn new(handle: ObjectHandle) -> Self
Build a new SimpleBuffer from an object handle.
Sourcepub fn handle(&self) -> &ObjectHandle
pub fn handle(&self) -> &ObjectHandle
Get the underlying object handle.
Sourcepub fn read(&self, buffer: &mut [u8]) -> usize
pub fn read(&self, buffer: &mut [u8]) -> usize
Read bytes from the SimpleBuffer into buffer
, up to the size of the supplied buffer. The
actual number of bytes copied is returned.
pub fn read_offset(&self, buffer: &mut [u8], offset: usize) -> usize
Sourcepub fn write(&mut self, buffer: &[u8]) -> usize
pub fn write(&mut self, buffer: &[u8]) -> usize
Write bytes from buffer
into the SimpleBuffer, up to the size of the supplied buffer. The
actual number of bytes copied is returned.
Sourcepub fn write_offset(&mut self, buffer: &[u8], offset: usize) -> usize
pub fn write_offset(&mut self, buffer: &[u8], offset: usize) -> usize
Write bytes from buffer
into the SimpleBuffer at provided offset, up to the size of the
supplied buffer, minus the offset. The actual number of bytes copied is returned.
Trait Implementations§
Auto Trait Implementations§
impl !Crossing for SimpleBuffer
impl Freeze for SimpleBuffer
impl !ObjSafe for SimpleBuffer
impl RefUnwindSafe for SimpleBuffer
impl Send for SimpleBuffer
impl Sync for SimpleBuffer
impl Unpin for SimpleBuffer
impl UnwindSafe for SimpleBuffer
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