Skip to content

Commit a24c59e

Browse files
committed
doc: add example use uefi::table::cfg::ConfigTableEntry
1 parent 2501be8 commit a24c59e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

uefi/src/system.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,23 @@ pub fn uefi_revision() -> Revision {
5151

5252
/// Call `f` with a slice of [`ConfigTableEntry`]. Each entry provides access to
5353
/// a vendor-specific table.
54+
///
55+
/// # Example
56+
///
57+
/// ```rust,no_run
58+
/// use uefi::system::with_config_table;
59+
/// use uefi::table::cfg::ConfigTableEntry;
60+
///
61+
/// with_config_table(|slice| {
62+
/// for i in slice {
63+
/// match i.guid {
64+
/// ConfigTableEntry::ACPI_GUID => println!("ACPI"),
65+
/// ConfigTableEntry::ACPI2_GUID => println!("ACPI2"),
66+
/// guid => println!("GUID: {}", guid),
67+
/// }
68+
/// }
69+
/// });
70+
/// ```
5471
pub fn with_config_table<F, R>(f: F) -> R
5572
where
5673
F: Fn(&[ConfigTableEntry]) -> R,

uefi/src/table/cfg.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
//!
99
//! This module contains the actual entries of the configuration table,
1010
//! as well as GUIDs for many known vendor tables.
11+
//!
12+
//! https://uefi.org/specs/UEFI/2.10/04_EFI_System_Table.html#efi-configuration-table-properties-table
1113
1214
use crate::{guid, Guid};
1315
use bitflags::bitflags;
@@ -16,6 +18,8 @@ use core::ffi::c_void;
1618
/// Contains a set of GUID / pointer for a vendor-specific table.
1719
///
1820
/// The UEFI standard guarantees each entry is unique.
21+
///
22+
/// https://uefi.org/specs/UEFI/2.10/04_EFI_System_Table.html#efi-configuration-table
1923
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
2024
#[repr(C)]
2125
pub struct ConfigTableEntry {

0 commit comments

Comments
 (0)