crosvm/base/src
Alexandre Courbot aa2e59d82f base: improve documentation of Descriptor and AsRawDescriptor
Although it can be useful for some limited cases, the Descriptor wrapper
class should ideally be eschewed and an alternative based on
implementing AsRawDescriptor on the right type be preferred. Make sure
its documentation reflects that.

The reason for avoiding Descriptor is that it encourages storing raw
descriptors that can possibly be closed before the user expects it. A
reasonable alternative to doing this is to call as_raw_descriptor() at
the exact moment the descriptor is needed, and never storing the result
- this ensures that the providing object (and underlying descriptor)
remain alive for long enough. Update the documentation of
AsRawDescriptor to explain and hopefully encourage this practice.

BUG=233968702
TEST=cargo build

Change-Id: I91c2ef11152b3b6adcc25f40d6de0a0f131700dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3670101
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-05-28 07:29:03 +00:00
..
sys devices: serial: introduce SerialInput trait 2022-05-26 10:09:52 +00:00
alloc.rs
clock.rs
descriptor.rs base: improve documentation of Descriptor and AsRawDescriptor 2022-05-28 07:29:03 +00:00
descriptor_reflection.rs
errno.rs
event.rs base: fix cargo doc warnings 2022-05-27 05:29:02 +00:00
external_mapping.rs
lib.rs base: remove ScopedEvent 2022-05-20 18:30:34 +00:00
mmap.rs
notifiers.rs
shm.rs
sys.rs
syslog.rs base: fix cargo doc warnings 2022-05-27 05:29:02 +00:00
timer.rs base: improve Timer wait/wait_for documentation 2022-05-18 17:47:05 +00:00
tube.rs
wait_context.rs base: return SmallVec directly from platform wait impls 2022-05-12 20:37:30 +00:00
write_zeroes.rs base: unify WriteZeroes and PunchHole traits 2022-05-06 18:14:25 +00:00