Struct uefi::proto::device_path::DevicePath

source ·
#[repr(C, packed(1))]
pub struct DevicePath { /* private fields */ }
Expand description

Device path protocol.

Can be used on any device handle to obtain generic path/location information concerning the physical device or logical device. If the handle does not logically map to a physical device, the handle may not necessarily support the device path protocol. The device path describes the location of the device the handle is for. The size of the Device Path can be determined from the structures that make up the Device Path.

See the module-level documentation for more details.

Implementations§

source§

impl DevicePath

source

pub unsafe fn from_ffi_ptr<'a>(ptr: *const FfiDevicePath) -> &'a DevicePath

Create a DevicePath reference from an opaque pointer.

§Safety

The input pointer must point to valid data. That data must remain valid for the lifetime 'a, and cannot be mutated during that lifetime.

source

pub const fn as_ffi_ptr(&self) -> *const FfiDevicePath

Cast to a FfiDevicePath pointer.

source

pub const fn instance_iter(&self) -> DevicePathInstanceIterator<'_>

Get an iterator over the DevicePathInstances in this path.

source

pub const fn node_iter(&self) -> DevicePathNodeIterator<'_>

Get an iterator over the DevicePathNodes starting at self. Iteration ends when a path is reached where is_end_entire is true. That ending path is not returned by the iterator.

source

pub const fn as_bytes(&self) -> &[u8]

Returns a slice of the underlying bytes.

source

pub fn to_boxed(&self) -> Box<Self>

Available on crate feature alloc only.

Returns a boxed copy of that value.

source

pub fn to_string( &self, bs: &BootServices, display_only: DisplayOnly, allow_shortcuts: AllowShortcuts ) -> Result<CString16, DevicePathToTextError>

Available on crate feature alloc only.

Transforms the device path to its string representation using the DevicePathToText protocol.

Trait Implementations§

source§

impl Debug for DevicePath

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Identify for DevicePath

source§

const GUID: Guid = uefi_raw::protocol::device_path::DevicePathProtocol::GUID

Unique protocol identifier.
source§

impl PartialEq for DevicePath

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Pointee for DevicePath
where [u8]: Pointee,

§

type Metadata = <[u8] as Pointee>::Metadata

The type for metadata in pointers and references to Self.
source§

impl ProtocolPointer for DevicePath

source§

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

Create a const pointer to a Protocol from a c_void pointer. Read more
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. Read more
source§

impl ToOwned for DevicePath

Available on crate feature alloc only.
§

type Owned = Box<DevicePath>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

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

impl Eq for DevicePath

source§

impl Protocol for DevicePath

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more