-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Expose other kqueue filters #83
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
considerations regarding #[inline]
and pub
src/os/kqueue.rs
Outdated
/// No matter what `PollMode` is specified, this filter will always be | ||
/// oneshot-only. | ||
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] | ||
pub struct Signal(c_int); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would make more sense to just make the single wrapped field pub
and omit the construct/destruct methods.
src/os/kqueue.rs
Outdated
/// Identifier for the timer. | ||
id: usize, | ||
|
||
/// The timeout to wait for. | ||
timeout: Duration, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider marking these pub
.
src/os/kqueue.rs
Outdated
|
||
impl Timer { | ||
/// Create a new timer. | ||
pub fn new(id: usize, timeout: Duration) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the fields of this struct would be marked pub
, these methods could be omitted.
suggestion: also uhh it's suboptimal that you put 2 independent changes into the last commit (one which moved the file, and a fixup), that makes it harder to review, would be nice if you could avoid that in the future... looks otherwise pretty ok now. thx |
Sorry about that, and thanks for the review! Regarding the |
oh btw the reason I suggested |
Good point. I've updated it so the fields are |
* feat: Expose other kqueue filters * Fix netbsd/openbsd compilation * Build MSRV for FreeBsd/OpenBsd in CI * Only run MSRV BSD builds on Linux * Change API a little + fix netbsd timer * Add inlines + move PollerSealed * rustfmt * Make filter fields public * Fix examples
This PR uses extension traits to expose other
kqueue
filters, like signals and child processes.Supercedes #72
Closes #68