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
type Ptr
Resulting pointer type
Required Methods
fn as_safe_ptr(&self) -> *const Self::Ptr
Returns a pointer that guarantees safe dereferencing on the front-end side.
Implementations on Foreign Types
impl<T> SafePtr for Vec<T>
[src]
impl<T> SafePtr for Vec<T>
type Ptr = T
fn as_safe_ptr(&self) -> *const T
[src]
fn as_safe_ptr(&self) -> *const T