pub trait VMHooksManagedBuffer: VMHooksHandlerSource {
// Provided methods
fn mb_new_empty(&self) -> RawHandle { ... }
fn mb_new_from_bytes(&self, bytes: &[u8]) -> RawHandle { ... }
fn mb_len(&self, handle: RawHandle) -> usize { ... }
fn mb_set(&self, handle: RawHandle, value: &[u8]) { ... }
unsafe fn mb_copy_bytes(
&self,
handle: RawHandle,
dest_ptr: *mut u8,
) -> usize { ... }
fn mb_load_slice(
&self,
source_handle: RawHandle,
starting_position: usize,
dest_slice: &mut [u8],
) -> i32 { ... }
fn mb_copy_slice(
&self,
source_handle: RawHandle,
starting_position: usize,
slice_len: usize,
dest_handle: RawHandle,
) -> i32 { ... }
fn mb_set_slice(
&self,
dest_handle: RawHandle,
starting_position: usize,
source_slice: &[u8],
) -> i32 { ... }
fn mb_append(&self, accumulator_handle: RawHandle, data_handle: RawHandle) { ... }
fn mb_append_bytes(&self, accumulator_handle: RawHandle, bytes: &[u8]) { ... }
fn mb_eq(&self, handle1: RawHandle, handle2: RawHandle) -> i32 { ... }
fn mb_to_hex(&self, source_handle: RawHandle, dest_handle: RawHandle) { ... }
}
Expand description
Provides VM hook implementations for methods that deal managed buffers.
Provided Methods§
fn mb_new_empty(&self) -> RawHandle
fn mb_new_from_bytes(&self, bytes: &[u8]) -> RawHandle
fn mb_len(&self, handle: RawHandle) -> usize
fn mb_set(&self, handle: RawHandle, value: &[u8])
Sourceunsafe fn mb_copy_bytes(&self, handle: RawHandle, dest_ptr: *mut u8) -> usize
unsafe fn mb_copy_bytes(&self, handle: RawHandle, dest_ptr: *mut u8) -> usize
Copies bytes from a stored managed buffer to the given pointer.
§Safety
Argument dest_ptr
should point to a valid location in memory, that has been pre-allocated with the appropriate size.