@@ -374,17 +374,40 @@ impl ToOwned for DevicePathInstance {
374
374
375
375
/// Device Path [`Protocol`].
376
376
///
377
- /// Can be used on any device handle to obtain generic path/location information
378
- /// concerning the physical device or logical device. If the handle does not
379
- /// logically map to a physical device, the handle may not necessarily support
380
- /// the device path protocol. The device path describes the location of the
381
- /// device the handle is for. The size of the Device Path can be determined from
382
- /// the structures that make up the Device Path.
377
+ /// A UEFI device path is a structured sequence of binary nodes that describe a
378
+ /// route from the UEFI root to a particular device, controller, or file. Each
379
+ /// node represents a step in the path: PCI device, partition, filesystem, file
380
+ /// path, etc.
381
+ ///
382
+ /// This type implements [`DevicePathProtocol`] and therefore can be used on any
383
+ /// device handle to obtain generic path/location information concerning the
384
+ /// physical device or logical device. If the handle does not logically map to a
385
+ /// physical device, the handle may not necessarily support the device path
386
+ /// protocol. The device path describes the location of the device the handle is
387
+ /// for. The size of the Device Path can be determined from the structures that
388
+ /// make up the Device Path.
383
389
///
384
390
/// See the [module-level documentation] for more details.
385
391
///
392
+ /// # Example
393
+ /// ```rust,no_run
394
+ /// use uefi::Handle;
395
+ /// use uefi::boot::{open_protocol_exclusive, ScopedProtocol};
396
+ /// use uefi::proto::device_path::DevicePath;
397
+ /// use uefi::proto::loaded_image::LoadedImage;
398
+ ///
399
+ /// fn open_device_path(image_handle: Handle) {
400
+ /// let loaded_image = open_protocol_exclusive::<LoadedImage>(image_handle).unwrap();
401
+ /// let device_handle = loaded_image.device().unwrap();
402
+ /// // We use `DevicePath` as protocol and also as return type.
403
+ /// let device_path: ScopedProtocol<DevicePath>
404
+ /// = open_protocol_exclusive::<DevicePath>(device_handle).unwrap();
405
+ /// }
406
+ /// ```
407
+ ///
386
408
/// [module-level documentation]: crate::proto::device_path
387
409
/// [`END_ENTIRE`]: DeviceSubType::END_ENTIRE
410
+ /// [`DevicePathProtocol`]: uefi_raw::protocol::device_path::DevicePathProtocol
388
411
/// [`Protocol`]: uefi::proto::Protocol
389
412
#[ repr( C , packed) ]
390
413
#[ unsafe_protocol( uefi_raw:: protocol:: device_path:: DevicePathProtocol :: GUID ) ]
0 commit comments