sdk-rust icon indicating copy to clipboard operation
sdk-rust copied to clipboard

[WIP] Support no_std

Open slinkydeveloper opened this issue 4 years ago • 3 comments

Followup of #94 Fixes #72

Breaking changes

This PR includes a breaking change to the Url type usage, in order to encapsulate it and "disable it" for no_std usage.

Now users should use cloudevents::event::types::Uri instead than url::Url.

No_std

no_std support replaces url::Url usages with String.

Signed-off-by: Francesco Guardiani [email protected]

slinkydeveloper avatar Apr 29 '21 12:04 slinkydeveloper

Looks good to me. I only think there should be some note that alloc is still required. Maybe having an alloc feature, like here: https://serde.rs/no-std.html#memory-allocation

ctron avatar Jun 09 '21 16:06 ctron

@ctron the problem is that without alloc i don't know how to implement extensions, because they require some dynamically allocated data structure, like a hashmap... Maybe there's a way we can implement it, but it requires a huge effort which i'm not sure is worth to...

slinkydeveloper avatar Jun 09 '21 16:06 slinkydeveloper

I agree, support for an alloc-free model is too much effort. My goal was more to make the user aware that alloc is required.

ctron avatar Jun 10 '21 10:06 ctron