You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is for research if and to what extent this feature is possible for Struson.
It is not guaranteed that it will be implemented, but feedback is appreciated! Feel free to add comments to share tips.
This issue might be extended or adjusted over time.
Description
Support usage of Struson in no_std environments. Struson as low-level JSON library might be useful for environments without std.
Goals
Support no_std environments
Some of the std traits used by Struson might not be available (related Rust issue). Have to search for solutions for that; maybe add traits in Struson which - if std is available - have implementations for the std traits, and otherwise users need to provide their own implementations.
If this is not possible, consider at least to reduce std dependencies (especially if it just a matter of adjusting use declarations) so that it is easier for users to create a no_std fork of Struson.
Non-goals
Support for no-alloc
While closely related to no_std, support for no-alloc could be a separate independent feature (and a separate GitHub issue here) which could also be useful even if alloc is available, for example to ensure no additional allocations are performed while reading JSON. For example JsonStreamReader could be created with a fixed sized value buffer, methods for reading String would require an alloc feature (enabled by default), and methods reading a str would return a new error type in case the value exceeds the fixed sized value buffer.
Note
This issue is for research if and to what extent this feature is possible for Struson.
It is not guaranteed that it will be implemented, but feedback is appreciated! Feel free to add comments to share tips.
This issue might be extended or adjusted over time.
Description
Support usage of Struson in
no_stdenvironments. Struson as low-level JSON library might be useful for environments without std.Goals
no_stdenvironmentsstdtraits used by Struson might not be available (related Rust issue). Have to search for solutions for that; maybe add traits in Struson which - ifstdis available - have implementations for thestdtraits, and otherwise users need to provide their own implementations.stddependencies (especially if it just a matter of adjustingusedeclarations) so that it is easier for users to create ano_stdfork of Struson.Non-goals
allocWhile closely related to
no_std, support for no-alloccould be a separate independent feature (and a separate GitHub issue here) which could also be useful even ifallocis available, for example to ensure no additional allocations are performed while reading JSON. For exampleJsonStreamReadercould be created with a fixed sized value buffer, methods for readingStringwould require anallocfeature (enabled by default), and methods reading astrwould return a new error type in case the value exceeds the fixed sized value buffer.