Skip to content

Commit 7354f7d

Browse files
committed
Document epoll, and remove the last allow(missing_docs) overrides.
1 parent de8aff1 commit 7354f7d

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

src/imp/libc/io/epoll.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454
//! # }
5555
//! ```
5656
57-
#![allow(missing_docs)] // TODO: Write more docs.
58-
5957
use super::super::c;
6058
use super::super::conv::{ret, ret_owned_fd, ret_u32};
6159
use crate::fd::{AsFd, AsRawFd, BorrowedFd, RawFd};
@@ -442,6 +440,7 @@ impl<'context, T: AsFd + IntoFd + FromFd> From<OwnedFd> for Epoll<Owning<'contex
442440
}
443441
}
444442

443+
/// An iterator over the `Event`s in an `EventVec`.
445444
pub struct Iter<'context, Context: self::Context> {
446445
iter: core::slice::Iter<'context, Event>,
447446
context: *const Context,
@@ -484,13 +483,15 @@ struct Event {
484483
encoded: u64,
485484
}
486485

486+
/// A vector of `Event`s, plus context for interpreting them.
487487
pub struct EventVec<'context, Context: self::Context> {
488488
events: Vec<Event>,
489489
context: *const Context,
490490
_phantom: PhantomData<&'context Context>,
491491
}
492492

493493
impl<'context, Context: self::Context> EventVec<'context, Context> {
494+
/// Constructs an `EventVec` with memory for `capacity` `Event`s.
494495
#[inline]
495496
pub fn with_capacity(capacity: usize) -> Self {
496497
Self {
@@ -500,31 +501,37 @@ impl<'context, Context: self::Context> EventVec<'context, Context> {
500501
}
501502
}
502503

504+
/// Returns the current `Event` capacity of this `EventVec`.
503505
#[inline]
504506
pub fn capacity(&self) -> usize {
505507
self.events.capacity()
506508
}
507509

510+
/// Reserves enough memory for at least `additional` more `Event`s.
508511
#[inline]
509512
pub fn reserve(&mut self, additional: usize) {
510513
self.events.reserve(additional);
511514
}
512515

516+
/// Reserves enough memory for exactly `additional` more `Event`s.
513517
#[inline]
514518
pub fn reserve_exact(&mut self, additional: usize) {
515519
self.events.reserve_exact(additional);
516520
}
517521

522+
/// Clears all the `Events` out of this `EventVec`.
518523
#[inline]
519524
pub fn clear(&mut self) {
520525
self.events.clear();
521526
}
522527

528+
/// Shrinks the capacity of this `EventVec` as much as possible.
523529
#[inline]
524530
pub fn shrink_to_fit(&mut self) {
525531
self.events.shrink_to_fit();
526532
}
527533

534+
/// Returns an iterator over the `Event`s in this `EventVec`.
528535
#[inline]
529536
pub fn iter(&self) -> Iter<'_, Context> {
530537
Iter {
@@ -534,6 +541,7 @@ impl<'context, Context: self::Context> EventVec<'context, Context> {
534541
}
535542
}
536543

544+
/// Returns the number of `Event`s logically contained in this `EventVec`.
537545
#[inline]
538546
pub fn len(&mut self) -> usize {
539547
self.events.len()

src/imp/linux_raw/io/epoll.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
//! ```
5656
5757
#![allow(unsafe_code)]
58-
#![allow(missing_docs)] // TODO: Write more docs.
5958

6059
use super::super::c;
6160
use crate::fd::{AsFd, AsRawFd, BorrowedFd, RawFd};
@@ -432,6 +431,7 @@ impl<'context, T: AsFd + IntoFd + FromFd> From<OwnedFd> for Epoll<Owning<'contex
432431
}
433432
}
434433

434+
/// An iterator over the `Event`s in an `EventVec`.
435435
pub struct Iter<'context, Context: self::Context> {
436436
iter: core::slice::Iter<'context, Event>,
437437
context: *const Context,
@@ -465,13 +465,15 @@ struct Event {
465465
encoded: u64,
466466
}
467467

468+
/// A vector of `Event`s, plus context for interpreting them.
468469
pub struct EventVec<'context, Context: self::Context> {
469470
events: Vec<Event>,
470471
context: *const Context,
471472
_phantom: PhantomData<&'context Context>,
472473
}
473474

474475
impl<'context, Context: self::Context> EventVec<'context, Context> {
476+
/// Constructs an `EventVec` with memory for `capacity` `Event`s.
475477
#[inline]
476478
pub fn with_capacity(capacity: usize) -> Self {
477479
Self {
@@ -481,31 +483,37 @@ impl<'context, Context: self::Context> EventVec<'context, Context> {
481483
}
482484
}
483485

486+
/// Returns the current `Event` capacity of this `EventVec`.
484487
#[inline]
485488
pub fn capacity(&self) -> usize {
486489
self.events.capacity()
487490
}
488491

492+
/// Reserves enough memory for at least `additional` more `Event`s.
489493
#[inline]
490494
pub fn reserve(&mut self, additional: usize) {
491495
self.events.reserve(additional);
492496
}
493497

498+
/// Reserves enough memory for exactly `additional` more `Event`s.
494499
#[inline]
495500
pub fn reserve_exact(&mut self, additional: usize) {
496501
self.events.reserve_exact(additional);
497502
}
498503

504+
/// Clears all the `Events` out of this `EventVec`.
499505
#[inline]
500506
pub fn clear(&mut self) {
501507
self.events.clear();
502508
}
503509

510+
/// Shrinks the capacity of this `EventVec` as much as possible.
504511
#[inline]
505512
pub fn shrink_to_fit(&mut self) {
506513
self.events.shrink_to_fit();
507514
}
508515

516+
/// Returns an iterator over the `Event`s in this `EventVec`.
509517
#[inline]
510518
pub fn iter(&self) -> Iter<'_, Context> {
511519
Iter {
@@ -515,6 +523,7 @@ impl<'context, Context: self::Context> EventVec<'context, Context> {
515523
}
516524
}
517525

526+
/// Returns the number of `Event`s logically contained in this `EventVec`.
518527
#[inline]
519528
pub fn len(&mut self) -> usize {
520529
self.events.len()

src/imp/linux_raw/io/io_slice.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! dca3f1b786efd27be3b325ed1e01e247aa589c3b.
44
55
#![allow(unsafe_code)]
6-
#![allow(missing_docs)]
76

87
use super::c;
98
use core::marker::PhantomData;

0 commit comments

Comments
 (0)