-
Notifications
You must be signed in to change notification settings - Fork 60
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
wasm: Fix operation not supported on std::fs. Closes #115 #166
Conversation
Interestingly, std::fs::File has both, too: https://github.com/rust-lang/rust/blob/8869ee03d7f258e1b76a11c6fbb01b5708a9f504/src/libstd/fs.rs#L647-L661 https://github.com/rust-lang/rust/blob/8869ee03d7f258e1b76a11c6fbb01b5708a9f504/src/libstd/fs.rs#L615-L628 Some explanation at https://stackoverflow.com/questions/28005134/how-do-i-implement-the-add-trait-for-a-reference-to-a-struct
Moved to a separate module, replaced std::fs everywhere, so far so good. Barely implemented any of the API, but that's all I'm using. However, it doesn't persist the data anywhere, yet. Would be used for configuration (conf.cfg), server list (servers.json), packet debugging (last-packet), resources (although it is disabled on wasm32 for now), and skins (ditto). Next up, use stdweb indexeddb branch (koute/stdweb#342) to provide a persistence backend. Start out simple first, but this could be useful for others to publish as a new crate. |
This reverts commit e268139.
As koute/stdweb#342 is still in review may change, and the Indexed DB API is quite complex, hacked up a quick and dirty Local Storage backend for now. Since it only stores strings, encoded the bytes as hex. This works, conf.cfg is written: and decodes correctly, albeit ugly. |
* Add new web-based std::fs replacement, localstoragefs: https://github.com/iceiix/localstoragefs * Add std_or_web to switch between std::fs (native) or localstoragefs (web) * Update www readme for new missing glutin/winit links, opens issue #171
* Add new web-based std::fs replacement, localstoragefs: https://github.com/iceiix/localstoragefs * Add std_or_web to switch between std::fs (native) or localstoragefs (web) * Update www readme for new missing glutin/winit links, opens issue #171
* Add new web-based std::fs replacement, localstoragefs: https://github.com/iceiix/localstoragefs * Add std_or_web to switch between std::fs (native) or localstoragefs (web) * Update www readme for new missing glutin/winit links, opens issue #171
* Add new web-based std::fs replacement, localstoragefs: https://github.com/iceiix/localstoragefs * Add std_or_web to switch between std::fs (native) or localstoragefs (web) * Update www readme for new missing glutin/winit links, opens issue #171
Implementing a minimal web-based std::fs replacement for #115 wasm broken: panicked at 'called
Result::unwrap()
on anErr
value: Custom { kind: Other, error: StringError("operation not supported on wasm yet") }