Hi there,
I was trying to use bcs in an environment without std support, after some hacking, I've put together a commit that compiles in a no_std environment: xxuejie@7e6b1f3 Some of my changes include:
- Switch from
std to core for components that exist in both crates, such as core::result::Result
- Use
Vec and String from alloc instead of std
- Add a just-enough
io module in no_std environment to minimize changes to existing logic
- (Perhaps the most controversial one), I have to use
onlyerror, which is like thiserror but works in no_std environment. And for this to work I have to switch to a nightly version of Rust, since core::error::Error is not stable yet. An alternative path is what postcard does now, but we lose the custom message
So my question here is: is no_std support that you would consider to be accepted to upstream? And if so, how do you suggest we deal with the thiserror issue?
Thanks!
Hi there,
I was trying to use bcs in an environment without std support, after some hacking, I've put together a commit that compiles in a
no_stdenvironment: xxuejie@7e6b1f3 Some of my changes include:stdtocorefor components that exist in both crates, such ascore::result::ResultVecandStringfrom alloc instead of stdiomodule inno_stdenvironment to minimize changes to existing logiconlyerror, which is likethiserrorbut works inno_stdenvironment. And for this to work I have to switch to a nightly version of Rust, sincecore::error::Erroris not stable yet. An alternative path is what postcard does now, but we lose the custom messageSo my question here is: is
no_stdsupport that you would consider to be accepted to upstream? And if so, how do you suggest we deal with thethiserrorissue?Thanks!