pub trait ProtocolPointer: Protocol {
// Required methods
unsafe fn ptr_from_ffi(ptr: *const c_void) -> *const Self;
unsafe fn mut_ptr_from_ffi(ptr: *mut c_void) -> *mut Self;
}
Expand description
Trait for creating a protocol pointer from a c_void
pointer.
There is a blanket implementation for all Sized
protocols that
simply casts the pointer to the appropriate type. Protocols that
are not sized must provide a custom implementation.
Create a const pointer to a Protocol
from a c_void
pointer.
The input pointer must point to valid data.
Create a mutable pointer to a Protocol
from a c_void
pointer.
The input pointer must point to valid data.