Trait uefi::proto::ProtocolPointer

source ·
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.

Required Methods§

source

unsafe fn ptr_from_ffi(ptr: *const c_void) -> *const Self

Create a const pointer to a Protocol from a c_void pointer.

§Safety

The input pointer must point to valid data.

source

unsafe fn mut_ptr_from_ffi(ptr: *mut c_void) -> *mut Self

Create a mutable pointer to a Protocol from a c_void pointer.

§Safety

The input pointer must point to valid data.

Object Safety§

This trait is not object safe.

Implementors§