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

StoreFieldReader and StoreFieldWriter should be public #3257

Closed
tqwewe opened this issue Nov 18, 2024 · 5 comments
Closed

StoreFieldReader and StoreFieldWriter should be public #3257

tqwewe opened this issue Nov 18, 2024 · 5 comments

Comments

@tqwewe
Copy link
Contributor

tqwewe commented Nov 18, 2024

Is your feature request related to a problem? Please describe.
Field's in reactive_store implement the StoreField trait, however the .reader() and .writer() methods on StoreField for Field returns private types: StoreFieldReader and StoreFieldWriter. This makes it impossible in cases where you might need to work with these types, since they cannot be imported.

Describe the solution you'd like
Make these types public.

@tqwewe
Copy link
Contributor Author

tqwewe commented Nov 18, 2024

When writing this issue, I wasn't actually aware these are read/write guards. However I'm not sure if that makes the issue no longer relevant or not.

The motivation for this is that I couldn't find a generic type for writing to a store field. Field implements read traits, but doesn't seem to implement anything for updating besides .writer() (unless I'm mistaken). I'm not sure if I can do anything such as try_maybe_update(...) on a store field due to the lack of impl Update for Field.

@gbj
Copy link
Collaborator

gbj commented Nov 18, 2024

Oops does Field not implement Write? Surely that's just an accidental omission on my part.

@tqwewe
Copy link
Contributor Author

tqwewe commented Nov 19, 2024

Is Field also planned to implement Update to allow for try_maybe_update(...)?

@gbj
Copy link
Collaborator

gbj commented Nov 19, 2024

Update is automatically implemented for all types that implement Write.

@tqwewe
Copy link
Contributor Author

tqwewe commented Nov 19, 2024

Oops my mistake, a manual impl of Update in thawui confused me with this. If the issue is resolved with 9718041 feel free to close. I don't have a real need for StoreFieldReader and StoreFieldWriter to be public anymore.

@gbj gbj closed this as completed in cff277b Nov 19, 2024
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

No branches or pull requests

2 participants