-
-
Notifications
You must be signed in to change notification settings - Fork 28
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 store providers to persistence module #251
Conversation
Dear Maxim, I have a colleague who is paying attention to this PR at any time and cooperating with the docking work of the client. You can replace him @Crayon-Shin-chan-1024 as reviewer, so that your design can have a better understanding with the downstream projects :) |
Thank you for the suggestion! First, he needs to accept invitation to the org |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #251 +/- ##
========================================
- Coverage 19.4% 19.2% -0.2%
========================================
Files 39 40 +1
Lines 8610 8604 -6
========================================
- Hits 1672 1655 -17
- Misses 6938 6949 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This solves the problem with saving and restoring Stock and related persistence objects in a custom way.
If a client of the library want to use custom store and load procedures, it has to do the following:
StoreProvider
for withMemStash
,MemState
andMemIndex
genericsStockStoreProvider
for itYou can check how it is done in https://github.com/RGB-WG/rgb-std/compare/store?expand=1#diff-ad8cec98dd4a1dac3d2a20e6c7a9c3e64129a3182285b50e1e3df20da2c167c7 where
PathBuf
becomes such store provider for a local file. If somebody needs to use Amazon S3 for instance, they can wrap thisPathBuf
into a custom structure and use its methods when needed.Two other related PRs: