Skip to content
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

Add capactity methods to packet_buffer & sockets #313

Merged
merged 4 commits into from Nov 5, 2019

Conversation

MabezDev
Copy link
Contributor

No description provided.

src/iface/ethernet.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@whitequark whitequark left a comment

Choose a reason for hiding this comment

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

For consistency, a similar change should be applied to TCP and UDP sockets too.

@MabezDev MabezDev changed the title Add capactity methods to packet_buffer & raw sockets Add capactity methods to packet_buffer & sockets Oct 30, 2019
@whitequark
Copy link
Contributor

I feel like the documentation would be more clear if instead of "element" it said which specific kind of element it means (packets and bytes depending on the kind of the socket). Also, please add dots at the end of sentences.

@MabezDev
Copy link
Contributor Author

MabezDev commented Nov 4, 2019

packets and bytes depending on the kind of the socket

The current methods only describe the capacities of the payload buffers, which are all bytes. Would you like me to add capacity methods for meta buffers for the socket types that support it (udp, icmp etc) too?

@whitequark
Copy link
Contributor

The current methods only describe the capacities of the payload buffers, which are all bytes. Would you like me to add capacity methods for meta buffers for the socket types that support it (udp, icmp etc) too?

Oh, good point. For those sockets, we should not have a single capacity method but two different ones. What about payload_capacity and packet_capacity?

Add packet capacity methods for appropriate socket types.
Update doc comments to better reflect the buffers item type
@whitequark whitequark merged commit a67ee07 into smoltcp-rs:master Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants