Skip to content

Split socket capabilities into individual operation traits. - #41

Merged
samuel-williams-shopify merged 2 commits into
mainfrom
refactor/socket-operation-capabilities
Oct 18, 2026
Merged

samuel-williams-shopify merged 2 commits into
mainfrom
refactor/socket-operation-capabilities

Conversation

@samuel-williams-shopify

@samuel-williams-shopify samuel-williams-shopify commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Split socket capabilities into individual operation traits, following the file capability model introduced in #40. Protocol code can now require SocketRead + SocketWrite for an existing connection without requiring socket creation, listening, options, or message I/O.

SocketOperation owns the shared Socket associated type. Each core operation has its own trait, and SocketScheduler is a blanket convenience aggregate. Message sending and receiving are independent capabilities, as are typed option getters and setters; SocketMessages and SocketOptions<O> automatically aggregate their respective pairs. Optional capabilities and resource registration depend only on SocketOperation.

Spell out address names throughout the public interface: SocketAddress re-exports std::net::SocketAddr, while SocketLocalAddress::socket_local_address and SocketPeerAddress::socket_peer_address replace the abbreviated inspection names. Both the executor and facade export the address type; standard-library addresses remain directly interchangeable.

Migrate native readiness, io_uring, Tokio, and simulated implementations while preserving operation signatures and runtime behavior. Update examples and conformance helpers to declare the operations they use, add a minimal in-memory read/write implementation and compile-time capability examples, and document migration for implementors and callers. This is a source-breaking API refactor: concrete callers import individual operation traits, and qualified resource paths use <S as SocketOperation>::Socket.

@samuel-williams-shopify
samuel-williams-shopify merged commit 14fc3e3 into main Oct 18, 2026
18 checks passed
@samuel-williams-shopify
samuel-williams-shopify deleted the refactor/socket-operation-capabilities branch October 18, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant