I am facing a little issue here, when i try to use the app_data, when creating a producer, i have made a struct for returning params for the signal, i get an error for use the AppData type i am getting a Serialize` is not satisfied,
any help would be awesome,.
thanks advance
mediasoup::data_structures
pub struct AppData
Container for arbitrary data attached to mediasoup entities.
6 implementations
the trait bound `mediasoup::data_structures::AppData: Serialize` is not satisfied
the trait `Serialize` is not implemented for `mediasoup::data_structures::AppData`rustcE0277
mod.rs(1899, 12): required by a bound in `utils::codec::_::_serde::ser::SerializeStruct::serialize_field`
the trait bound `mediasoup::data_structures::AppData: Deserialize<'_>` is not satisfied
the trait `Deserialize<'_>` is not implemented for `mediasoup::data_structures::AppData`rustcE0277
mod.rs(1719, 12): required by a bound in `next_element`
I hope itβs not a problem to bump a thread like this, but I wanted to add some more info that may help others in the future.
If you want to preserve app_data in a generic way, I found that using serde_json::Value is a good way to preserve json formatted data without locking it to a specific structure. You can set the type to this for any place that needs to handle serialize/deserialize. You can then switch between the types cleanly by using .downcast_ref::<serde_json::Value>() to go from AppData β serde_json::Value and AppData::new(app_data) to go back.