pub const fn to_raw_ptr<T>(from: T) -> *const T::PtrTarget
where T: GetPointerKind<Kind = PK_Reference>,
Expand description

Converts the from pointer to a raw pointer.

Example

use abi_stable::pointer_trait::immutable_ref;

unsafe {
    const X: *const u32 = immutable_ref::to_raw_ptr(&8u32);
    assert_eq!(*X, 8u32);
}