Skip to content

Commit 379d53a

Browse files
committed
uefi: improve doc for device paths
1 parent 8651810 commit 379d53a

File tree

1 file changed

+23
-5
lines changed
  • uefi/src/proto/device_path

1 file changed

+23
-5
lines changed

uefi/src/proto/device_path/mod.rs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
//!
3838
//! # Types
3939
//!
40-
//! To represent device paths, this module provides several types:
40+
//! This module defines several types used to represent device paths.
41+
//! For constructing device paths, see the [`build`] module.
4142
//!
4243
//! * [`DevicePath`] is the root type that represents a full device
4344
//! path, containing one or more device path instance. It ends with an
@@ -80,6 +81,13 @@
8081
//! Note: the API provided by this module is currently mostly limited to
8182
//! reading existing device paths rather than constructing new ones.
8283
//!
84+
//! # Submodules
85+
//!
86+
//! - utilities to construct device paths: [`build`]
87+
//! - utilities to transform device paths to a textual representation: [`text`]
88+
//! - DevicePathUtilities protocol:: [`util`]
89+
//!
90+
//!
8391
//! [`END_ENTIRE`]: DeviceSubType::END_ENTIRE
8492
//! [`END_INSTANCE`]: DeviceSubType::END_INSTANCE
8593
//! [`Protocol`]: crate::proto::Protocol
@@ -343,9 +351,14 @@ impl<'a> TryFrom<&'a [u8]> for &'a DevicePathNode {
343351
}
344352
}
345353

346-
/// A single device path instance that ends with either an [`END_INSTANCE`]
347-
/// or [`END_ENTIRE`] node. Use [`DevicePath::instance_iter`] to get the
348-
/// path instances in a [`DevicePath`].
354+
/// A single device path instance within a fully-qualified [`DevicePath`], which
355+
/// ends with either an [`END_INSTANCE`] or [`END_ENTIRE`] node.
356+
///
357+
/// An instance is one of possibly multiple complete route to the target, e.g.,
358+
/// a file can be located via network device one or two.
359+
///
360+
/// Use [`DevicePath::instance_iter`] to get the path instances in a
361+
/// [`DevicePath`].
349362
///
350363
/// See the [module-level documentation] for more details.
351364
///
@@ -411,11 +424,16 @@ impl ToOwned for DevicePathInstance {
411424
}
412425
}
413426

414-
/// High-level representation of the UEFI [device path protocol].
427+
/// High-level representation of the UEFI [device path protocol], often simply
428+
/// referred to as "device path".
415429
///
416430
/// This type represents an entire device path, possibly consisting of multiple
417431
/// [`DevicePathInstance`]s and [`DevicePathNode`]s.
418432
///
433+
/// Further, this Rust type is a DST and therefore typically exists as reference
434+
/// to parse underlying data correspondingly. To get an owned device path, you
435+
/// can use [`DevicePath::to_owned`].
436+
///
419437
/// See the [module-level documentation] for more details.
420438
///
421439
/// # Usage

0 commit comments

Comments
 (0)