@@ -347,17 +347,40 @@ impl ToOwned for DevicePathInstance {
347
347
348
348
/// Device Path [`Protocol`].
349
349
///
350
- /// Can be used on any device handle to obtain generic path/location information
351
- /// concerning the physical device or logical device. If the handle does not
352
- /// logically map to a physical device, the handle may not necessarily support
353
- /// the device path protocol. The device path describes the location of the
354
- /// device the handle is for. The size of the Device Path can be determined from
355
- /// the structures that make up the Device Path.
350
+ /// A UEFI device path is a structured sequence of binary nodes that describe a
351
+ /// route from the UEFI root to a particular device, controller, or file. Each
352
+ /// node represents a step in the path: PCI device, partition, filesystem, file
353
+ /// path, etc.
354
+ ///
355
+ /// This type implements [`DevicePathProtocol`] and therefore can be used on any
356
+ /// device handle to obtain generic path/location information concerning the
357
+ /// physical device or logical device. If the handle does not logically map to a
358
+ /// physical device, the handle may not necessarily support the device path
359
+ /// protocol. The device path describes the location of the device the handle is
360
+ /// for. The size of the Device Path can be determined from the structures that
361
+ /// make up the Device Path.
356
362
///
357
363
/// See the [module-level documentation] for more details.
358
364
///
365
+ /// # Example
366
+ /// ```rust,no_run
367
+ /// use uefi::Handle;
368
+ /// use uefi::boot::{open_protocol_exclusive, ScopedProtocol};
369
+ /// use uefi::proto::device_path::DevicePath;
370
+ /// use uefi::proto::loaded_image::LoadedImage;
371
+ ///
372
+ /// fn open_device_path(image_handle: Handle) {
373
+ /// let loaded_image = open_protocol_exclusive::<LoadedImage>(image_handle).unwrap();
374
+ /// let device_handle = loaded_image.device().unwrap();
375
+ /// // We use `DevicePath` as protocol and also as return type.
376
+ /// let device_path: ScopedProtocol<DevicePath>
377
+ /// = open_protocol_exclusive::<DevicePath>(device_handle).unwrap();
378
+ /// }
379
+ /// ```
380
+ ///
359
381
/// [module-level documentation]: crate::proto::device_path
360
382
/// [`END_ENTIRE`]: DeviceSubType::END_ENTIRE
383
+ /// [`DevicePathProtocol`]: uefi_raw::protocol::device_path::DevicePathProtocol
361
384
/// [`Protocol`]: uefi::proto::Protocol
362
385
#[ repr( C , packed) ]
363
386
#[ unsafe_protocol( uefi_raw:: protocol:: device_path:: DevicePathProtocol :: GUID ) ]
0 commit comments