larry-robotics / elkodon

Elkodon - true zero-copy inter-process-communication in rust
Apache License 2.0
14 stars 2 forks source link

elk-#47 Introduce maybe uninit for publisher and sample mut #58

Closed elBoberido closed 7 months ago

elBoberido commented 7 months ago

Notes for Reviewer

This PR introduces a RawSample/RawSampleMut as a drop in replacement for NonNull with additional methods to reduce the unsafe code. Additionally, MaybeUninit is used to prevent publishing uninitialized samples.

Pre-Review Checklist for the PR Author

  1. [x] Add sensible notes for the reviewer
  2. [x] PR title is short, expressive and meaningful
  3. [x] Relevant issues are linked
  4. [x] Every source code file has the SPDX header SPDX-License-Identifier: $(LICENSE_CODE)
  5. [x] Branch follows the naming format (elk-123-introduce-posix-ipc-example)
  6. [x] Commits messages are according to this guideline
    • [x] Commit messages have the issue ID ([#123] Add posix ipc example)
    • [x] Commit author matches Eclipse Contributor Agreement (and ECA is signed)
  7. [x] Tests follow the best practice for testing
  8. [x] Changelog updated in the unreleased section including API breaking changes
  9. [x] Assign PR to reviewer
  10. [x] All checks have passed (except task-list-completed)

Checklist for the PR Reviewer

Post-review Checklist for the PR Author

  1. [x] All open points are addressed and tracked via issues

References

Use either 'Closes #123' or 'Relates to #123' to reference the corresponding issue.

Relates to #47

codecov[bot] commented 7 months ago

Codecov Report

Merging #58 (c027600) into main (1ee834a) will decrease coverage by 0.21%. Report is 3 commits behind head on main. The diff coverage is 51.49%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/elkodon/elkodon/pull/58/graphs/tree.svg?width=650&height=150&src=pr&token=57QN0YX5DJ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elkodon)](https://app.codecov.io/gh/elkodon/elkodon/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elkodon) ```diff @@ Coverage Diff @@ ## main #58 +/- ## ========================================== - Coverage 77.35% 77.15% -0.21% ========================================== Files 167 169 +2 Lines 18797 18905 +108 ========================================== + Hits 14541 14586 +45 - Misses 4256 4319 +63 ``` | [Files](https://app.codecov.io/gh/elkodon/elkodon/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elkodon) | Coverage Δ | | |---|---|---| | [elkodon/src/port/publisher.rs](https://app.codecov.io/gh/elkodon/elkodon/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elkodon#diff-ZWxrb2Rvbi9zcmMvcG9ydC9wdWJsaXNoZXIucnM=) | `80.88% <100.00%> (+0.34%)` | :arrow_up: | | [elkodon/src/port/subscriber.rs](https://app.codecov.io/gh/elkodon/elkodon/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elkodon#diff-ZWxrb2Rvbi9zcmMvcG9ydC9zdWJzY3JpYmVyLnJz) | `72.15% <100.00%> (+0.91%)` | :arrow_up: | | [elkodon/src/sample.rs](https://app.codecov.io/gh/elkodon/elkodon/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elkodon#diff-ZWxrb2Rvbi9zcmMvc2FtcGxlLnJz) | `46.15% <50.00%> (-25.28%)` | :arrow_down: | | [elkodon/src/message.rs](https://app.codecov.io/gh/elkodon/elkodon/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elkodon#diff-ZWxrb2Rvbi9zcmMvbWVzc2FnZS5ycw==) | `0.00% <0.00%> (ø)` | | | [elkodon/src/sample\_mut.rs](https://app.codecov.io/gh/elkodon/elkodon/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elkodon#diff-ZWxrb2Rvbi9zcmMvc2FtcGxlX211dC5ycw==) | `68.08% <54.16%> (-7.78%)` | :arrow_down: | | [elkodon/src/raw\_sample.rs](https://app.codecov.io/gh/elkodon/elkodon/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elkodon#diff-ZWxrb2Rvbi9zcmMvcmF3X3NhbXBsZS5ycw==) | `37.83% <37.83%> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/elkodon/elkodon/pull/58/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elkodon)