Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement Index<usize> for Events #681
Comments
carllerche
added
the
help wanted
label
Aug 19, 2017
This comment has been minimized.
This comment has been minimized.
|
This isn't trivial. The epoll implementation of |
This comment has been minimized.
This comment has been minimized.
|
Ah yes this isn't implementable easily and intentionally so, we often perform translations on the returned events from the system to coalesce and/or generate more mio events. |
dtolnay
closed this
Aug 20, 2017
This comment has been minimized.
This comment has been minimized.
|
Actually I'm pretty sure we wanted to deprecate indexed access in favor of an iterator only API. |
This comment has been minimized.
This comment has been minimized.
|
I filed #697 to follow up if necessary. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dtolnay commentedAug 19, 2017
The mio::Events type looks a lot like Vec - it has a function get(usize) -> Option<Event> which returns None if the index is out of bounds, and it has IntoIterator. It would be convenient to implement Index to enable square-bracket indexing that panics on out of bounds.