Trait ffi_utils::SafePtr [] [src]

pub trait SafePtr {
    type Ptr;
    fn as_safe_ptr(&self) -> *const Self::Ptr;
}

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).

Associated Types

Resulting pointer type

Required Methods

Returns a pointer that guarantees safe dereferencing on the front-end side.

Implementors