pub struct OutputBuffers { /* private fields */ }
Expand description
CoreVM output buffers (service counterpart).
The service uses this struct to collect output from the guest.
The builder counterpart.
Implementations§
Source§impl OutputBuffers
impl OutputBuffers
Sourcepub fn pre_allocate(&mut self, i: OutputStream, len: usize) -> &mut [u8]
pub fn pre_allocate(&mut self, i: OutputStream, len: usize) -> &mut [u8]
Pre-allocate len
bytes in output buffer i
.
Returns the mutable slice that references the pre-allocated space.
Sourcepub fn export_segments<F, E>(&mut self, export: F) -> Result<(), E>
pub fn export_segments<F, E>(&mut self, export: F) -> Result<(), E>
Export all buffers as segments.
Normally export
should simply call export_slice
.
Use Self::segment_count_after
to ensure that max. no. of exported segments is not
surpassed.
Sourcepub fn stream_len(&self) -> [u32; 4]
pub fn stream_len(&self) -> [u32; 4]
Returns the size of each stream.
Sourcepub fn segment_count(&self) -> usize
pub fn segment_count(&self) -> usize
Returns the no. of segments the buffers would require on export.
Sourcepub fn segment_count_after(&self, i: OutputStream, len: usize) -> Option<usize>
pub fn segment_count_after(&self, i: OutputStream, len: usize) -> Option<usize>
Returns the no. of segments the buffers will require on export after len
bytes is appended
to buffer i
.
Trait Implementations§
Source§impl Debug for OutputBuffers
impl Debug for OutputBuffers
Source§impl Default for OutputBuffers
impl Default for OutputBuffers
Source§fn default() -> OutputBuffers
fn default() -> OutputBuffers
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OutputBuffers
impl RefUnwindSafe for OutputBuffers
impl Send for OutputBuffers
impl Sync for OutputBuffers
impl Unpin for OutputBuffers
impl UnwindSafe for OutputBuffers
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