Skip to content

refactor(driver): require Default for Control#859

Merged
George-Miao merged 1 commit intocompio-rs:masterfrom
George-Miao:refactor/driver/control-default
Apr 13, 2026
Merged

refactor(driver): require Default for Control#859
George-Miao merged 1 commit intocompio-rs:masterfrom
George-Miao:refactor/driver/control-default

Conversation

@George-Miao
Copy link
Copy Markdown
Member

Close #741, again

Copilot AI review requested due to automatic review settings April 12, 2026 21:31
@George-Miao George-Miao self-assigned this Apr 12, 2026
@George-Miao George-Miao added package: driver Related to compio-driver refactor Refactoring existing code labels Apr 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Refactors driver operation control initialization by requiring Default for OpCode::Control and switching init to initialize an existing control value in-place, enabling control storage to be created up-front.

Changes:

  • Updated all OpCode::init implementations to the new fn init(&mut self, ctrl: &mut Self::Control) signature.
  • Added Default implementations/derives for multiple Control types (and SysSlice) to satisfy the new trait bound.
  • Refactored Carrier to store initialized control state directly (removing MaybeUninit flow) and to initialize based on stored DriverType.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
compio-runtime/tests/event.rs Updates test opcode init signature to in-place control init
compio-runtime/src/fd/poll_fd/windows.rs Updates Windows event opcode init signature
compio-process/src/windows.rs Updates process wait opcode init signature
compio-fs/src/stdio/windows.rs Updates stdio blocking opcodes init signature
compio-driver/tests/splice.rs Updates splice test opcode init signature
compio-driver/src/sys_slice.rs Adds Default for SysSlice; updates construction docs
compio-driver/src/sys/unix_op.rs Adds Default for various vectored/msg controls and switches to in-place control creation
compio-driver/src/sys/stub/op.rs Updates stub opcodes to new init signature
compio-driver/src/sys/stub/mod.rs Requires Control: Default and changes init signature in stub trait
compio-driver/src/sys/poll/op.rs Updates poll driver ops to new init signature; adds Default for AIO controls
compio-driver/src/sys/poll/mod.rs Requires Control: Default and changes init signature in poll trait
compio-driver/src/sys/iour/op/mod.rs Updates io_uring ops to new init signature; introduces SmallVec for slices
compio-driver/src/sys/iour/op/managed.rs Updates managed io_uring ops to in-place control init; adds control defaults
compio-driver/src/sys/iour/mod.rs Requires Control: Default and changes init signature in io_uring trait
compio-driver/src/sys/iocp/op.rs Updates IOCP ops to new init signature; derives Default for several controls
compio-driver/src/sys/iocp/mod.rs Requires Control: Default and changes init signature in IOCP trait
compio-driver/src/sys/fusion/op.rs Updates fusion wrappers to forward new init signature
compio-driver/src/key.rs Switches Carrier creation/init flow to new API
compio-driver/src/control.rs Refactors Carrier to store initialized control directly and init in-place

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread compio-driver/src/sys/poll/mod.rs
Comment thread compio-driver/src/sys/iour/mod.rs
Comment thread compio-driver/src/sys/iocp/mod.rs
Comment thread compio-driver/src/control.rs
@George-Miao George-Miao force-pushed the refactor/driver/control-default branch from 7b5751d to 6a8a484 Compare April 13, 2026 00:36
@George-Miao George-Miao requested a review from Berrysoft April 13, 2026 00:58
@George-Miao George-Miao enabled auto-merge April 13, 2026 01:46
@George-Miao George-Miao added this pull request to the merge queue Apr 13, 2026
Merged via the queue into compio-rs:master with commit df7ebac Apr 13, 2026
68 checks passed
@George-Miao George-Miao deleted the refactor/driver/control-default branch April 13, 2026 01:51
@github-actions github-actions bot mentioned this pull request Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: driver Related to compio-driver refactor Refactoring existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking issue: Refactor driver with control API

3 participants