Skip to content

Trouble Implementing Tokio-util Decoder for MQTT Broker #46

@CianToole

Description

@CianToole

I am pretty new to Rust and MQTT, and I was following this series of articles (https://hassamuddin.com/blog/rust-mqtt/overview/) on writing an async MQTT broker in Rust. As this article is a little dated, I was attempting to update it to use the most recent version of tokio-util (v0.6.8) and mqttrs (v0.4.1).

I think I have been able to update most of the code in that example located here (https://github.com/Heasummn/rust-mqtt), but I have run into some trouble trying to implement tokio_util::codec::Decoder. It seems that my problem comes from the lifetime attached to the Packet enum.

I was wondering if there was a potential workaround for this problem. Something to make the Decoder happy so I can see if everything else is working as it should be. Please let me know if you need any more information from me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions