Skip to content

Commit d0c4b8f

Browse files
authored
Add more epoll:: qualifiers to epoll's public API. (#1132)
Qualify more types and functions in epoll's public API with `epoll::` qualifiers.
1 parent 5ab7762 commit d0c4b8f

1 file changed

Lines changed: 19 additions & 17 deletions

File tree

src/event/epoll.rs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ use core::slice;
8686

8787
/// `epoll_create1(flags)`—Creates a new epoll object.
8888
///
89-
/// Use the [`CreateFlags::CLOEXEC`] flag to prevent the resulting file
89+
/// Use the [`epoll::CreateFlags::CLOEXEC`] flag to prevent the resulting file
9090
/// descriptor from being implicitly passed across `exec` boundaries.
9191
///
9292
/// # References
@@ -207,7 +207,7 @@ pub fn wait(epoll: impl AsFd, event_list: &mut EventVec, timeout: c::c_int) -> i
207207
Ok(())
208208
}
209209

210-
/// An iterator over the `Event`s in an `EventVec`.
210+
/// An iterator over the [`epoll::Event`]s in an [`epoll::EventVec`].
211211
pub struct Iter<'a> {
212212
/// Use `Copied` to copy the struct, since `Event` is `packed` on some
213213
/// platforms, and it's common for users to directly destructure it, which
@@ -216,7 +216,7 @@ pub struct Iter<'a> {
216216
}
217217

218218
impl<'a> Iterator for Iter<'a> {
219-
type Item = Event;
219+
type Item = epoll::Event;
220220

221221
#[inline]
222222
fn next(&mut self) -> Option<Self::Item> {
@@ -258,8 +258,8 @@ pub struct Event {
258258
_pad: u64,
259259
}
260260

261-
/// Data associated with an [`Event`]. This can either be a 64-bit integer
262-
/// value or a pointer which preserves pointer provenance.
261+
/// Data associated with an [`epoll::Event`]. This can either be a 64-bit
262+
/// integer value or a pointer which preserves pointer provenance.
263263
#[repr(C)]
264264
#[derive(Copy, Clone)]
265265
pub union EventData {
@@ -340,15 +340,15 @@ struct SixtyFourBitPointer {
340340
_padding: u32,
341341
}
342342

343-
/// A vector of `Event`s, plus context for interpreting them.
343+
/// A vector of `epoll::Event`s, plus context for interpreting them.
344344
#[cfg(feature = "alloc")]
345345
pub struct EventVec {
346346
events: Vec<Event>,
347347
}
348348

349349
#[cfg(feature = "alloc")]
350350
impl EventVec {
351-
/// Constructs an `EventVec` from raw pointer, length, and capacity.
351+
/// Constructs an `epoll::EventVec` from raw pointer, length, and capacity.
352352
///
353353
/// # Safety
354354
///
@@ -362,59 +362,61 @@ impl EventVec {
362362
}
363363
}
364364

365-
/// Constructs an `EventVec` with memory for `capacity` `Event`s.
365+
/// Constructs an `epoll::EventVec` with memory for `capacity`
366+
/// `epoll::Event`s.
366367
#[inline]
367368
pub fn with_capacity(capacity: usize) -> Self {
368369
Self {
369370
events: Vec::with_capacity(capacity),
370371
}
371372
}
372373

373-
/// Returns the current `Event` capacity of this `EventVec`.
374+
/// Returns the current `epoll::Event` capacity of this `epoll::EventVec`.
374375
#[inline]
375376
pub fn capacity(&self) -> usize {
376377
self.events.capacity()
377378
}
378379

379-
/// Reserves enough memory for at least `additional` more `Event`s.
380+
/// Reserves enough memory for at least `additional` more `epoll::Event`s.
380381
#[inline]
381382
pub fn reserve(&mut self, additional: usize) {
382383
self.events.reserve(additional);
383384
}
384385

385-
/// Reserves enough memory for exactly `additional` more `Event`s.
386+
/// Reserves enough memory for exactly `additional` more `epoll::Event`s.
386387
#[inline]
387388
pub fn reserve_exact(&mut self, additional: usize) {
388389
self.events.reserve_exact(additional);
389390
}
390391

391-
/// Clears all the `Events` out of this `EventVec`.
392+
/// Clears all the `epoll::Events` out of this `epoll::EventVec`.
392393
#[inline]
393394
pub fn clear(&mut self) {
394395
self.events.clear();
395396
}
396397

397-
/// Shrinks the capacity of this `EventVec` as much as possible.
398+
/// Shrinks the capacity of this `epoll::EventVec` as much as possible.
398399
#[inline]
399400
pub fn shrink_to_fit(&mut self) {
400401
self.events.shrink_to_fit();
401402
}
402403

403-
/// Returns an iterator over the `Event`s in this `EventVec`.
404+
/// Returns an iterator over the `epoll::Event`s in this `epoll::EventVec`.
404405
#[inline]
405406
pub fn iter(&self) -> Iter<'_> {
406407
Iter {
407408
iter: self.events.iter().copied(),
408409
}
409410
}
410411

411-
/// Returns the number of `Event`s logically contained in this `EventVec`.
412+
/// Returns the number of `epoll::Event`s logically contained in this
413+
/// `epoll::EventVec`.
412414
#[inline]
413415
pub fn len(&mut self) -> usize {
414416
self.events.len()
415417
}
416418

417-
/// Tests whether this `EventVec` is logically empty.
419+
/// Tests whether this `epoll::EventVec` is logically empty.
418420
#[inline]
419421
pub fn is_empty(&mut self) -> bool {
420422
self.events.is_empty()
@@ -424,7 +426,7 @@ impl EventVec {
424426
#[cfg(feature = "alloc")]
425427
impl<'a> IntoIterator for &'a EventVec {
426428
type IntoIter = Iter<'a>;
427-
type Item = Event;
429+
type Item = epoll::Event;
428430

429431
#[inline]
430432
fn into_iter(self) -> Self::IntoIter {

0 commit comments

Comments
 (0)