#[repr(transparent)]
pub struct Handle(_);
Expand description

Opaque handle to an UEFI entity (protocol, image…), guaranteed to be non-null.

If you need to have a nullable handle (for a custom UEFI FFI for example) use Option<Handle>.

Implementations

Creates a new Handle from a raw address. The address might come from the Multiboot2 information structure or something similar.

Example
use core::ffi::c_void;
use uefi::Handle;

let image_handle_addr = 0xdeadbeef as *mut c_void;

let uefi_image_handle = unsafe {
    Handle::from_ptr(image_handle_addr).expect("Pointer must not be null!")
};
Safety

This function is unsafe because the caller must be sure that the pointer is valid. Otherwise, further operations on the object might result in undefined behaviour, even if the methods aren’t marked as unsafe.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.