|
17 | 17 | //! a hypervisor).
|
18 | 18 | //!
|
19 | 19 | //! Traits and Structs
|
20 |
| -//! - [GuestAddress](struct.GuestAddress.html): represents a guest physical address (GPA). |
21 |
| -//! - [MemoryRegionAddress](struct.MemoryRegionAddress.html): represents an offset inside a region. |
22 |
| -//! - [GuestMemoryRegion](trait.GuestMemoryRegion.html): represent a continuous region of guest's |
| 20 | +//! - [`GuestAddress`](struct.GuestAddress.html): represents a guest physical address (GPA). |
| 21 | +//! - [`MemoryRegionAddress`](struct.MemoryRegionAddress.html): represents an offset inside a |
| 22 | +//! region. |
| 23 | +//! - [`GuestMemoryRegion`](trait.GuestMemoryRegion.html): represent a continuous region of guest's |
23 | 24 | //! physical memory.
|
24 |
| -//! - [GuestMemory](trait.GuestMemory.html): represent a collection of GuestMemoryRegion objects. |
25 |
| -//! The main responsibilities of the GuestMemory trait are: |
| 25 | +//! - [`GuestMemory`](trait.GuestMemory.html): represent a collection of `GuestMemoryRegion` |
| 26 | +//! objects. |
| 27 | +//! The main responsibilities of the `GuestMemory` trait are: |
26 | 28 | //! - hide the detail of accessing guest's physical address.
|
27 |
| -//! - map a request address to a GuestMemoryRegion object and relay the request to it. |
28 |
| -//! - handle cases where an access request spanning two or more GuestMemoryRegion objects. |
| 29 | +//! - map a request address to a `GuestMemoryRegion` object and relay the request to it. |
| 30 | +//! - handle cases where an access request spanning two or more `GuestMemoryRegion` objects. |
29 | 31 | //!
|
30 |
| -//! Whenever a collection of GuestMemoryRegion objects is mutable, |
31 |
| -//! [GuestAddressSpace](trait.GuestAddressSpace.html) should be implemented |
32 |
| -//! for clients to obtain a [GuestMemory] reference or smart pointer. |
| 32 | +//! Whenever a collection of `GuestMemoryRegion` objects is mutable, |
| 33 | +//! [`GuestAddressSpace`](trait.GuestAddressSpace.html) should be implemented |
| 34 | +//! for clients to obtain a [`GuestMemory`] reference or smart pointer. |
33 | 35 |
|
34 | 36 | use std::convert::From;
|
35 | 37 | use std::fmt::{self, Display};
|
@@ -122,7 +124,7 @@ impl_address_ops!(GuestAddress, u64);
|
122 | 124 | pub struct MemoryRegionAddress(pub u64);
|
123 | 125 | impl_address_ops!(MemoryRegionAddress, u64);
|
124 | 126 |
|
125 |
| -/// Type of the raw value stored in a GuestAddress object. |
| 127 | +/// Type of the raw value stored in a `GuestAddress` object. |
126 | 128 | pub type GuestUsize = <GuestAddress as AddressValue>::V;
|
127 | 129 |
|
128 | 130 | /// Represents the start point within a `File` that backs a `GuestMemoryRegion`.
|
@@ -287,15 +289,15 @@ pub trait GuestMemoryRegion: Bytes<MemoryRegionAddress, E = Error> {
|
287 | 289 | }
|
288 | 290 | }
|
289 | 291 |
|
290 |
| -/// GuestAddressSpace provides a way to retrieve a GuestMemory object. |
| 292 | +/// `GuestAddressSpace` provides a way to retrieve a `GuestMemory` object. |
291 | 293 | /// The vm-memory crate already provides trivial implementation for
|
292 |
| -/// references to GuestMemory or reference-counted GuestMemory objects, |
| 294 | +/// references to `GuestMemory` or reference-counted `GuestMemory` objects, |
293 | 295 | /// but the trait can also be implemented by any other struct in order
|
294 | 296 | /// to provide temporary access to a snapshot of the memory map.
|
295 | 297 | ///
|
296 | 298 | /// In order to support generic mutable memory maps, devices (or other things
|
297 |
| -/// that access memory) should store the memory as a GuestAddressSpace<M>. |
298 |
| -/// This example shows that references can also be used as the GuestAddressSpace |
| 299 | +/// that access memory) should store the memory as a `GuestAddressSpace<M>`. |
| 300 | +/// This example shows that references can also be used as the `GuestAddressSpace` |
299 | 301 | /// implementation, providing a zero-cost abstraction whenever immutable memory
|
300 | 302 | /// maps are sufficient.
|
301 | 303 | ///
|
@@ -391,15 +393,15 @@ impl<M: GuestMemory> GuestAddressSpace for Arc<M> {
|
391 | 393 | }
|
392 | 394 | }
|
393 | 395 |
|
394 |
| -/// GuestMemory represents a container for an *immutable* collection of |
395 |
| -/// GuestMemoryRegion objects. GuestMemory provides the `Bytes<GuestAddress>` |
| 396 | +/// `GuestMemory` represents a container for an *immutable* collection of |
| 397 | +/// `GuestMemoryRegion` objects. `GuestMemory` provides the `Bytes<GuestAddress>` |
396 | 398 | /// trait to hide the details of accessing guest memory by physical address.
|
397 |
| -/// Interior mutability is not allowed for implementations of GuestMemory so |
| 399 | +/// Interior mutability is not allowed for implementations of `GuestMemory` so |
398 | 400 | /// that they always provide a consistent view of the memory map.
|
399 | 401 | ///
|
400 |
| -/// The task of the GuestMemory trait are: |
401 |
| -/// - map a request address to a GuestMemoryRegion object and relay the request to it. |
402 |
| -/// - handle cases where an access request spanning two or more GuestMemoryRegion objects. |
| 402 | +/// The task of the `GuestMemory` trait are: |
| 403 | +/// - map a request address to a `GuestMemoryRegion` object and relay the request to it. |
| 404 | +/// - handle cases where an access request spanning two or more `GuestMemoryRegion` objects. |
403 | 405 | pub trait GuestMemory {
|
404 | 406 | /// Type of objects hosted by the address space.
|
405 | 407 | type R: GuestMemoryRegion;
|
|
0 commit comments