-
Notifications
You must be signed in to change notification settings - Fork 2
refactor!(core): rework attribute semantics #226
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #226 +/- ##
==========================================
- Coverage 80.67% 79.21% -1.46%
==========================================
Files 51 52 +1
Lines 6850 6953 +103
==========================================
- Hits 5526 5508 -18
- Misses 1324 1445 +121 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
cedricchevalier19
left a comment
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.
Looks ok, I will mainly trust the Rust toolchain on this PR.
| /// validate the transaction passed as argument. The result should not be processed manually, | ||
| /// only used via the `?` operator. | ||
| /// |
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.
I do not really follow? Do you mean that even if the result value is not interesting, the user has to check if ok?
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.
I believe the stm crate uses these errors to detect invalid transaction (early?), so yes, the ? operator should be called on every results inside a transaction, including Result<(), StmError>.
We can set something up this week to go over the API and any questions / shortcomings. |
Sorry for the size of the last 2 PRs!
New semantic over attributes:
sewmethods to allow for more control #224)sewmethods to allow for more control #224)read: read a valuewrite: (over)write a value, returning the old oneremove: remove a value, returning itDone:
CMapErrorCMapResult<T> = Result<T, CMapError>AttributeStorage<A>&UnknownAttributeStorageto use the new semanticAttrSparseVecAttrStorageManagerto use the new semanticFollow-up:
CMapResult<A>where possible / coherentCMapResult<Option<A>>AttributeUpdatefallback methods to returnCMapResult<Self>