Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
loongs-zhang committed Feb 28, 2025
1 parent 0b3c82d commit 4340f8b
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions monoio/src/driver/iocp/event.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::slice::{Iter, IterMut};

use mio::Token;
use windows_sys::Win32::System::IO::OVERLAPPED_ENTRY;

Expand Down Expand Up @@ -117,13 +119,30 @@ impl Events {
*status = unsafe { std::mem::zeroed() };
}
}

pub fn iter(&self) -> Iter<'_, Event> {
self.events.iter()
}

pub fn iter_mut(&mut self) -> IterMut<'_, Event> {
self.events.iter_mut()
}
}

impl<'a> IntoIterator for &'a Events {
type Item = &'a Event;
type IntoIter = std::slice::Iter<'a>;
type IntoIter = Iter<'a>;

fn into_iter(self) -> Self::IntoIter {
self.events.iter()
self.iter()
}
}

impl<'a> IntoIterator for &'a mut Events {
type Item = &'a mut Event;
type IntoIter = Iter<'a>;

fn into_iter(self) -> Self::IntoIter {
self.iter_mut()
}
}

0 comments on commit 4340f8b

Please sign in to comment.