pub trait ResizableBuffer {
// Required methods
fn get_buffer(&self) -> &[u8] ⓘ;
fn get_buffer_mut(&mut self) -> &mut [u8] ⓘ;
fn begin_to_grow(&mut self) -> Result<&mut [u8], BufferError>;
fn commit(&mut self);
fn rollback(&mut self);
}Expand description
The IResizableBuffer interface.
Matches:
struct IResizableBuffer {
virtual span<std::byte> GetBuffer() = 0;
virtual span<std::byte> BeginToGrow() = 0;
virtual void Commit() = 0;
virtual void Rollback() = 0;
};Required Methods§
Sourcefn get_buffer(&self) -> &[u8] ⓘ
fn get_buffer(&self) -> &[u8] ⓘ
Get the current buffer as a byte slice.
Sourcefn get_buffer_mut(&mut self) -> &mut [u8] ⓘ
fn get_buffer_mut(&mut self) -> &mut [u8] ⓘ
Get the current buffer as a mutable byte slice.
Sourcefn begin_to_grow(&mut self) -> Result<&mut [u8], BufferError>
fn begin_to_grow(&mut self) -> Result<&mut [u8], BufferError>
Begin a grow operation and return the new (larger) buffer.
Existing content is copied to the FRONT of the new buffer.
The caller may relocate content; then call commit() (or
rollback() to cancel).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".