{"id":13668018,"url":"https://github.com/zonyitoo/mqtt-rs","last_synced_at":"2025-04-12T20:45:08.356Z","repository":{"id":44548989,"uuid":"42571895","full_name":"zonyitoo/mqtt-rs","owner":"zonyitoo","description":"MQTT protocol library for Rust","archived":false,"fork":false,"pushed_at":"2024-03-13T14:13:10.000Z","size":245,"stargazers_count":182,"open_issues_count":6,"forks_count":38,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-04T00:08:52.225Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zonyitoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-16T07:31:07.000Z","updated_at":"2025-03-03T05:39:07.000Z","dependencies_parsed_at":"2024-06-19T02:47:11.393Z","dependency_job_id":"5c20ec6f-7c71-45dc-8910-a537a8b020ca","html_url":"https://github.com/zonyitoo/mqtt-rs","commit_stats":{"total_commits":116,"total_committers":14,"mean_commits":8.285714285714286,"dds":0.4482758620689655,"last_synced_commit":"02fa0d44b07f25433e80a839c9b531898e032d33"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonyitoo%2Fmqtt-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonyitoo%2Fmqtt-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonyitoo%2Fmqtt-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonyitoo%2Fmqtt-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zonyitoo","download_url":"https://codeload.github.com/zonyitoo/mqtt-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631687,"owners_count":21136556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T07:00:59.711Z","updated_at":"2025-04-12T20:45:08.330Z","avatar_url":"https://github.com/zonyitoo.png","language":"Rust","funding_links":[],"categories":["Clients","Rust"],"sub_categories":["Rust"],"readme":"# MQTT-rs\n\n[![Build Status](https://img.shields.io/travis/zonyitoo/mqtt-rs.svg)](https://travis-ci.org/zonyitoo/mqtt-rs)\n![Build \u0026 Test](https://github.com/zonyitoo/mqtt-rs/workflows/Build%20\u0026%20Test/badge.svg)\n[![License](https://img.shields.io/github/license/zonyitoo/mqtt-rs.svg)](https://github.com/zonyitoo/mqtt-rs)\n[![crates.io](https://img.shields.io/crates/v/mqtt-protocol.svg)](https://crates.io/crates/mqtt-protocol)\n[![dependency status](https://deps.rs/repo/github/zonyitoo/mqtt-rs/status.svg)](https://deps.rs/repo/github/zonyitoo/mqtt-rs)\n\nMQTT protocol library for Rust\n\n```toml\n[dependencies]\nmqtt-protocol = \"0.12\"\n```\n\n## Usage\n\n```rust\nextern crate mqtt;\n\nuse std::io::Cursor;\n\nuse mqtt::{Encodable, Decodable};\nuse mqtt::packet::{VariablePacket, PublishPacket, QoSWithPacketIdentifier};\nuse mqtt::TopicName;\n\nfn main() {\n    // Create a new Publish packet\n    let packet = PublishPacket::new(TopicName::new(\"mqtt/learning\").unwrap(),\n                                    QoSWithPacketIdentifier::Level2(10),\n                                    \"Hello MQTT!\");\n\n    // Encode\n    let mut buf = Vec::new();\n    packet.encode(\u0026mut buf).unwrap();\n    println!(\"Encoded: {:?}\", buf);\n\n    // Decode it with known type\n    let mut dec_buf = Cursor::new(\u0026buf[..]);\n    let decoded = PublishPacket::decode(\u0026mut dec_buf).unwrap();\n    println!(\"Decoded: {:?}\", decoded);\n    assert_eq!(packet, decoded);\n\n    // Auto decode by the fixed header\n    let mut dec_buf = Cursor::new(\u0026buf[..]);\n    let auto_decode = VariablePacket::decode(\u0026mut dec_buf).unwrap();\n    println!(\"Variable packet decode: {:?}\", auto_decode);\n    assert_eq!(VariablePacket::PublishPacket(packet), auto_decode);\n}\n```\n\n## Note\n\n* Based on [MQTT 3.1.1](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonyitoo%2Fmqtt-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzonyitoo%2Fmqtt-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonyitoo%2Fmqtt-rs/lists"}