Struct uefi::proto::device_path::DevicePathNode
source · [−]#[repr(C, packed)]pub struct DevicePathNode { /* private fields */ }
Expand description
A single node within a DevicePath
.
Each node starts with a DevicePathHeader
. The rest of the data
in the node depends on the type of node.
See the module-level documentation for more details.
Implementations
sourceimpl DevicePathNode
impl DevicePathNode
sourcepub unsafe fn from_ffi_ptr<'a>(ptr: *const FfiDevicePath) -> &'a DevicePathNode
pub unsafe fn from_ffi_ptr<'a>(ptr: *const FfiDevicePath) -> &'a DevicePathNode
Create a DevicePathNode
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.
sourcepub fn as_ffi_ptr(&self) -> *const FfiDevicePath
pub fn as_ffi_ptr(&self) -> *const FfiDevicePath
Cast to a FfiDevicePath
pointer.
sourcepub fn device_type(&self) -> DeviceType
pub fn device_type(&self) -> DeviceType
Type of device
sourcepub fn sub_type(&self) -> DeviceSubType
pub fn sub_type(&self) -> DeviceSubType
Sub type of device
sourcepub fn full_type(&self) -> (DeviceType, DeviceSubType)
pub fn full_type(&self) -> (DeviceType, DeviceSubType)
Tuple of the node’s type and subtype.
sourcepub fn length(&self) -> u16
pub fn length(&self) -> u16
Size (in bytes) of the full DevicePathNode
, including the header.
sourcepub fn is_end_entire(&self) -> bool
pub fn is_end_entire(&self) -> bool
True if this node ends an entire DevicePath
.
sourcepub fn as_file_path_media_device_path(&self) -> Option<&FilePathMediaDevicePath>
pub fn as_file_path_media_device_path(&self) -> Option<&FilePathMediaDevicePath>
Convert to a FilePathMediaDevicePath
. Returns None
if the
node is not of the appropriate type.
Trait Implementations
sourceimpl Debug for DevicePathNode
impl Debug for DevicePathNode
sourceimpl PartialEq<DevicePathNode> for DevicePathNode
impl PartialEq<DevicePathNode> for DevicePathNode
sourcefn eq(&self, other: &DevicePathNode) -> bool
fn eq(&self, other: &DevicePathNode) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more