mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-28 04:21:50 -06:00
rust: qemu_api: add a documentation header for all modules
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
d128c341a7
commit
ebacd14a6f
7 changed files with 27 additions and 0 deletions
|
@ -2,9 +2,13 @@
|
|||
// Author(s): Paolo Bonzini <pbonzini@redhat.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#![doc(hidden)]
|
||||
//! This module provides macros to check the equality of types and
|
||||
//! the type of `struct` fields. This can be useful to ensure that
|
||||
//! types match the expectations of C code.
|
||||
//!
|
||||
//! Documentation is hidden because it only exposes macros, which
|
||||
//! are exported directly from `qemu_api`.
|
||||
|
||||
// Based on https://stackoverflow.com/questions/64251852/x/70978292#70978292
|
||||
// (stackoverflow answers are released under MIT license).
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
clippy::missing_safety_doc
|
||||
)]
|
||||
|
||||
//! `bindgen`-generated declarations.
|
||||
|
||||
#[cfg(MESON)]
|
||||
include!("bindings.inc.rs");
|
||||
|
||||
|
|
|
@ -2,6 +2,14 @@
|
|||
// Author(s): Paolo Bonzini <pbonzini@redhat.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#![doc(hidden)]
|
||||
//! This module provides a macro to define a constant of type
|
||||
//! [`CStr`](std::ffi::CStr), for compatibility with versions of
|
||||
//! Rust that lack `c""` literals.
|
||||
//!
|
||||
//! Documentation is hidden because it only exposes macros, which
|
||||
//! are exported directly from `qemu_api`.
|
||||
|
||||
#[macro_export]
|
||||
/// Given a string constant _without_ embedded or trailing NULs, return
|
||||
/// a `CStr`.
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#![doc(hidden)]
|
||||
//! This module provides macros that emulate the functionality of
|
||||
//! `core::mem::offset_of` on older versions of Rust.
|
||||
//!
|
||||
//! Documentation is hidden because it only exposes macros, which
|
||||
//! are exported directly from `qemu_api`.
|
||||
|
||||
/// This macro provides the same functionality as `core::mem::offset_of`,
|
||||
/// except that only one level of field access is supported. The declaration
|
||||
/// of the struct must be wrapped with `with_offsets! { }`.
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// Author(s): Paolo Bonzini <pbonzini@redhat.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
//! Commonly used traits and types for QEMU.
|
||||
|
||||
pub use crate::bitops::IntegerExt;
|
||||
|
||||
pub use crate::cell::BqlCell;
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// Author(s): Paolo Bonzini <pbonzini@redhat.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
//! Bindings to access `sysbus` functionality from Rust.
|
||||
|
||||
use std::{ffi::CStr, ptr::addr_of_mut};
|
||||
|
||||
pub use bindings::{SysBusDevice, SysBusDeviceClass};
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
//! Defines a trait for structs that can be safely initialized with zero bytes.
|
||||
|
||||
/// Encapsulates the requirement that
|
||||
/// `MaybeUninit::<Self>::zeroed().assume_init()` does not cause undefined
|
||||
/// behavior. This trait in principle could be implemented as just:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue