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
How can I serialize an alloc::string::String or alloc::vec::Vec in no_std environment?
I have been using these two data structures in a no_std rust project, but I have encountered a problem that #[derive(Serialize, Deserialize)] cannot generate the proper function
#[derive(Serialize,Deserialize)]pub(crate)structTest{pub(crate)test:String,// this is alloc::string::String in no_std environment}
error[E0277]: the trait bound `String: Serialize` is not satisfied
--> src/image/mod.rs:36:5
|
36 | pub(crate) test: String,
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Serialize` is not implemented for `String`
|
= note: required by `image::_::_serde::ser::SerializeStruct::serialize_field`
error[E0277]: the trait bound `String: Deserialize<'_>` is not satisfied
--> src/image/mod.rs:36:5
|
36 | pub(crate) test: String,
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `String`
|
= note: required by `next_element`
error[E0277]: the trait bound `String: Deserialize<'_>` is not satisfied
--> src/image/mod.rs:36:5
|
36 | pub(crate) test: String,
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `String`
|
= note: required by `next_value`
The text was updated successfully, but these errors were encountered:
How can I serialize an alloc::string::String or alloc::vec::Vec in no_std environment?
I have been using these two data structures in a no_std rust project, but I have encountered a problem that #[derive(Serialize, Deserialize)] cannot generate the proper function
The text was updated successfully, but these errors were encountered: