-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to implement tokio_util::codec::{Decoder, Encoder} with mqttrs version 0.4 #45
Comments
@00imvj00 any ideas, pointers or suggestions? Thanks! |
@svanharmelen apologies for the delayed reply. This is a known issue. @MathiasKoch has integrated this with async, he might be able to help more. I hope. @MathiasKoch any ideas??? |
I have not used in any async code at all. All my applications are I am however currently running with a fork of this, as i am doing some other no-std, no-alloc optimizations for my application, so feel free to disregard me currently. I do hope we can patch stuff together eventually, for a good community mqtt encoder crate that can be used across the entire ecosystem. |
I recently tried to update Now that it's been a few months, how are people approaching this? Are there examples of integrations that I could look at? If I could propose a solution that uses pub enum Packet<'a> {
Connect(Connect<'a>),
Connack(Connack),
...
}
pub enum PacketOwned {
Connect(ConnectOwned),
Connack(Connack),
...
}
impl<'a> Packet<'a> {
pub fn to_owned(&'a self) -> PacketOwned {
...
}
} |
I updated our app to use
tokio
1.x the other day, and with that I also updatedmqttrs
from 0.3 to 0.4. But sincePacket
now requires a lifetime, I don't see how I can implementtokio_util::codec::{Decoder, Encoder}
using this version.I tried the following code:
But this gives me:
Do you have any suggestions or pointers on how to make this work again with
mqttrs
0.4? Thanks!The text was updated successfully, but these errors were encountered: