Skip to content

Commit 2f42ea8

Browse files
committed
doc: add minimal example to lib.rs
1 parent 5dc4386 commit 2f42ea8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Diff for: uefi/src/lib.rs

+20
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@
77
//! important UEFI concepts. For more details of UEFI, see the latest [UEFI
88
//! Specification][spec].
99
//!
10+
//! # Minimal Example
11+
//!
12+
//! This is a minimal example for an UEFI image using functionality of the
13+
//! `uefi` crate.
14+
//!
15+
//! ```ignore
16+
//! #![no_main]
17+
//! #![no_std]
18+
//! use uefi::prelude::*;
19+
//!
20+
//! #[entry]
21+
//! fn main(_image_handle: Handle, _system_table: SystemTable<Boot>) -> Status {
22+
//! uefi::helpers::init().unwrap();
23+
//! println!("Hello world!");
24+
//! Status::SUCCESS
25+
//! }
26+
//! ```
27+
//!
28+
//! Please find more info in our [Rust UEFI Book].
29+
//!
1030
//! # Value-add and Use Cases
1131
//!
1232
//! `uefi` supports writing code for both pre- and post-exit boot services

0 commit comments

Comments
 (0)