pub trait SafePtr {
type Ptr;
// Required method
fn as_safe_ptr(&self) -> *const Self::Ptr;
}Expand description
Provides FFI-safe pointers, as opposed to raw as_ptr() in Vec and String which can return
values such as 0x01 that can cause segmentation faults with the automatic pointer
dereferencing on the front-end side (e.g. in Node.js).
Required Associated Types§
Required Methods§
Sourcefn as_safe_ptr(&self) -> *const Self::Ptr
fn as_safe_ptr(&self) -> *const Self::Ptr
Returns a pointer that guarantees safe dereferencing on the front-end side.