Skip to content

no_std support #124

Description

@Marcono1234

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_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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestresearchIssue or pull request representing experimental research

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions