Files
pilot/pilot-v2/target/debug/.fingerprint/pilot-v2-480f329b39111cf8/output-lib-pilot_v2
Gilles Soulier c5381b7112 Pilot v2: Core implementation + battery telemetry
Major updates:
- Complete Rust rewrite (pilot-v2/) with working MQTT client
- Fixed MQTT event loop deadlock (background task pattern)
- Battery telemetry for Linux (auto-detected via /sys/class/power_supply)
- Home Assistant auto-discovery for all sensors and switches
- Comprehensive documentation (AVANCEMENT.md, CLAUDE.md, roadmap)
- Docker test environment with Mosquitto broker
- Helper scripts for development and testing

Features working:
 MQTT connectivity with LWT
 YAML configuration with validation
 Telemetry: CPU, memory, IP, battery (Linux)
 Commands: shutdown, reboot, sleep, screen (dry-run tested)
 HA discovery and integration
 Allowlist and cooldown protection

Ready for testing on real hardware.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 06:23:00 +01:00

12 lines
32 KiB
Plaintext

{"$message_type":"diagnostic","message":"unresolved imports `sysinfo::CpuExt`, `sysinfo::SystemExt`","code":{"code":"E0432","explanation":"An import was unresolved.\n\nErroneous code example:\n\n```compile_fail,E0432\nuse something::Foo; // error: unresolved import `something::Foo`.\n```\n\nIn Rust 2015, paths in `use` statements are relative to the crate root. To\nimport items relative to the current and parent modules, use the `self::` and\n`super::` prefixes, respectively.\n\nIn Rust 2018 or later, paths in `use` statements are relative to the current\nmodule unless they begin with the name of a crate or a literal `crate::`, in\nwhich case they start from the crate root. As in Rust 2015 code, the `self::`\nand `super::` prefixes refer to the current and parent modules respectively.\n\nAlso verify that you didn't misspell the import name and that the import exists\nin the module from where you tried to import it. Example:\n\n```\nuse self::something::Foo; // Ok.\n\nmod something {\n pub struct Foo;\n}\n# fn main() {}\n```\n\nIf you tried to use a module from an external crate and are using Rust 2015,\nyou may have missed the `extern crate` declaration (which is usually placed in\nthe crate root):\n\n```edition2015\nextern crate core; // Required to use the `core` crate in Rust 2015.\n\nuse core::any;\n# fn main() {}\n```\n\nSince Rust 2018 the `extern crate` declaration is not required and\nyou can instead just `use` it:\n\n```edition2018\nuse core::any; // No extern crate required in Rust 2018.\n# fn main() {}\n```\n"},"level":"error","spans":[{"file_name":"src/telemetry/mod.rs","byte_start":156,"byte_end":162,"line_start":5,"line_end":5,"column_start":15,"column_end":21,"is_primary":true,"text":[{"text":"use sysinfo::{CpuExt, System, SystemExt};","highlight_start":15,"highlight_end":21}],"label":"no `CpuExt` in the root","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/telemetry/mod.rs","byte_start":172,"byte_end":181,"line_start":5,"line_end":5,"column_start":31,"column_end":40,"is_primary":true,"text":[{"text":"use sysinfo::{CpuExt, System, SystemExt};","highlight_start":31,"highlight_end":40}],"label":"no `SystemExt` in the root","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"a similar name exists in the module","code":null,"level":"help","spans":[{"file_name":"src/telemetry/mod.rs","byte_start":172,"byte_end":181,"line_start":5,"line_end":5,"column_start":31,"column_end":40,"is_primary":true,"text":[{"text":"use sysinfo::{CpuExt, System, SystemExt};","highlight_start":31,"highlight_end":40}],"label":null,"suggested_replacement":"System","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0432]\u001b[0m\u001b[1m: unresolved imports `sysinfo::CpuExt`, `sysinfo::SystemExt`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/telemetry/mod.rs:5:15\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m5\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use sysinfo::{CpuExt, System, SystemExt};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^^\u001b[0m \u001b[1m\u001b[91m^^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m \u001b[1m\u001b[91mno `SystemExt` in the root\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m \u001b[1m\u001b[91mhelp: a similar name exists in the module: `System`\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91mno `CpuExt` in the root\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"failed to resolve: could not find `signal` in `tokio`","code":{"code":"E0433","explanation":"An undeclared crate, module, or type was used.\n\nErroneous code example:\n\n```compile_fail,E0433\nlet map = HashMap::new();\n// error: failed to resolve: use of undeclared type `HashMap`\n```\n\nPlease verify you didn't misspell the type/module's name or that you didn't\nforget to import it:\n\n```\nuse std::collections::HashMap; // HashMap has been imported.\nlet map: HashMap<u32, u32> = HashMap::new(); // So it can be used!\n```\n\nIf you've expected to use a crate name:\n\n```compile_fail\nuse ferris_wheel::BigO;\n// error: failed to resolve: use of undeclared module or unlinked crate\n```\n\nMake sure the crate has been added as a dependency in `Cargo.toml`.\n\nTo use a module from your current crate, add the `crate::` prefix to the path.\n"},"level":"error","spans":[{"file_name":"src/runtime/mod.rs","byte_start":2465,"byte_end":2471,"line_start":73,"line_end":73,"column_start":31,"column_end":37,"is_primary":true,"text":[{"text":" let shutdown = tokio::signal::ctrl_c();","highlight_start":31,"highlight_end":37}],"label":"could not find `signal` in `tokio`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"found an item that was configured out","code":null,"level":"note","spans":[{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/cfg.rs","byte_start":9512,"byte_end":9530,"line_start":414,"line_end":414,"column_start":19,"column_end":37,"is_primary":false,"text":[{"text":" #[cfg(feature = \"signal\")]","highlight_start":19,"highlight_end":37}],"label":"the item is gated behind the `signal` feature","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/lib.rs","byte_start":20211,"byte_end":20246,"line_start":540,"line_end":542,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"cfg_signal! {","highlight_start":1,"highlight_end":1},{"text":" pub mod signal;","highlight_start":1,"highlight_end":1},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"cfg_signal!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/cfg.rs","byte_start":9431,"byte_end":9454,"line_start":411,"line_end":411,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"macro_rules! cfg_signal {","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/lib.rs","byte_start":20237,"byte_end":20243,"line_start":541,"line_end":541,"column_start":13,"column_end":19,"is_primary":true,"text":[{"text":" pub mod signal;","highlight_start":13,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"found an item that was configured out","code":null,"level":"note","spans":[{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/cfg.rs","byte_start":9800,"byte_end":9852,"line_start":426,"line_end":426,"column_start":22,"column_end":74,"is_primary":false,"text":[{"text":" #[cfg(any(feature = \"signal\", all(unix, feature = \"process\")))]","highlight_start":22,"highlight_end":74}],"label":"the item is gated here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/lib.rs","byte_start":20248,"byte_end":20389,"line_start":544,"line_end":549,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"cfg_signal_internal! {","highlight_start":1,"highlight_end":23},{"text":" #[cfg(not(feature = \"signal\"))]","highlight_start":1,"highlight_end":36},{"text":" #[allow(dead_code)]","highlight_start":1,"highlight_end":24},{"text":" #[allow(unreachable_pub)]","highlight_start":1,"highlight_end":30},{"text":" pub(crate) mod signal;","highlight_start":1,"highlight_end":27},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"cfg_signal_internal!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/cfg.rs","byte_start":9707,"byte_end":9739,"line_start":423,"line_end":423,"column_start":1,"column_end":33,"is_primary":false,"text":[{"text":"macro_rules! cfg_signal_internal {","highlight_start":1,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/lib.rs","byte_start":20380,"byte_end":20386,"line_start":548,"line_end":548,"column_start":20,"column_end":26,"is_primary":true,"text":[{"text":" pub(crate) mod signal;","highlight_start":20,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0433]\u001b[0m\u001b[1m: failed to resolve: could not find `signal` in `tokio`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:73:31\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m73\u001b[0m \u001b[1m\u001b[94m|\u001b[0m let shutdown = tokio::signal::ctrl_c();\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^^\u001b[0m \u001b[1m\u001b[91mcould not find `signal` in `tokio`\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[92mnote\u001b[0m: found an item that was configured out\n \u001b[1m\u001b[94m--> \u001b[0m/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/lib.rs:541:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m540\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m/\u001b[0m cfg_signal! {\n\u001b[1m\u001b[94m541\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub mod signal;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[92m^^^^^^\u001b[0m\n\u001b[1m\u001b[94m542\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|_-\u001b[0m \u001b[1m\u001b[94mthe item is gated behind the `signal` feature\u001b[0m\n\u001b[1m\u001b[92mnote\u001b[0m: found an item that was configured out\n \u001b[1m\u001b[94m--> \u001b[0m/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/lib.rs:548:20\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m544\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m/\u001b[0m cfg_signal_internal! {\n\u001b[1m\u001b[94m545\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m #[cfg(not(feature = \"signal\"))]\n\u001b[1m\u001b[94m546\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m #[allow(dead_code)]\n\u001b[1m\u001b[94m547\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m #[allow(unreachable_pub)]\n\u001b[1m\u001b[94m548\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub(crate) mod signal;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[92m^^^^^^\u001b[0m\n\u001b[1m\u001b[94m549\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|_-\u001b[0m \u001b[1m\u001b[94mthe item is gated here\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"unused import: `Path`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/config/mod.rs","byte_start":223,"byte_end":227,"line_start":6,"line_end":6,"column_start":17,"column_end":21,"is_primary":true,"text":[{"text":"use std::path::{Path, PathBuf};","highlight_start":17,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove the unused import","code":null,"level":"help","spans":[{"file_name":"src/config/mod.rs","byte_start":223,"byte_end":229,"line_start":6,"line_end":6,"column_start":17,"column_end":23,"is_primary":true,"text":[{"text":"use std::path::{Path, PathBuf};","highlight_start":17,"highlight_end":23}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"src/config/mod.rs","byte_start":222,"byte_end":223,"line_start":6,"line_end":6,"column_start":16,"column_end":17,"is_primary":true,"text":[{"text":"use std::path::{Path, PathBuf};","highlight_start":16,"highlight_end":17}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"src/config/mod.rs","byte_start":236,"byte_end":237,"line_start":6,"line_end":6,"column_start":30,"column_end":31,"is_primary":true,"text":[{"text":"use std::path::{Path, PathBuf};","highlight_start":30,"highlight_end":31}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `Path`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/config/mod.rs:6:17\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m6\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use std::path::{Path, PathBuf};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default\n\n"}
{"$message_type":"diagnostic","message":"no method named `clone` found for struct `DeviceInfo` in the current scope","code":{"code":"E0599","explanation":"This error occurs when a method is used on a type which doesn't implement it:\n\nErroneous code example:\n\n```compile_fail,E0599\nstruct Mouth;\n\nlet x = Mouth;\nx.chocolate(); // error: no method named `chocolate` found for type `Mouth`\n // in the current scope\n```\n\nIn this case, you need to implement the `chocolate` method to fix the error:\n\n```\nstruct Mouth;\n\nimpl Mouth {\n fn chocolate(&self) { // We implement the `chocolate` method here.\n println!(\"Hmmm! I love chocolate!\");\n }\n}\n\nlet x = Mouth;\nx.chocolate(); // ok!\n```\n"},"level":"error","spans":[{"file_name":"src/ha/mod.rs","byte_start":2357,"byte_end":2362,"line_start":66,"line_end":66,"column_start":43,"column_end":48,"is_primary":true,"text":[{"text":" device: DeviceInfo { ..device.clone() },","highlight_start":43,"highlight_end":48}],"label":"method not found in `DeviceInfo`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/ha/mod.rs","byte_start":213,"byte_end":230,"line_start":9,"line_end":9,"column_start":1,"column_end":18,"is_primary":false,"text":[{"text":"struct DeviceInfo {","highlight_start":1,"highlight_end":18}],"label":"method `clone` not found for this struct","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"items from traits can only be used if the trait is implemented and in scope","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"the following trait defines an item `clone`, perhaps you need to implement it:\ncandidate #1: `Clone`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0599]\u001b[0m\u001b[1m: no method named `clone` found for struct `DeviceInfo` in the current scope\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ha/mod.rs:66:43\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m9\u001b[0m \u001b[1m\u001b[94m|\u001b[0m struct DeviceInfo {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m-----------------\u001b[0m \u001b[1m\u001b[94mmethod `clone` not found for this struct\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m66\u001b[0m \u001b[1m\u001b[94m|\u001b[0m device: DeviceInfo { ..device.clone() },\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^\u001b[0m \u001b[1m\u001b[91mmethod not found in `DeviceInfo`\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: items from traits can only be used if the trait is implemented and in scope\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: the following trait defines an item `clone`, perhaps you need to implement it:\n candidate #1: `Clone`\n\n"}
{"$message_type":"diagnostic","message":"no method named `clone` found for struct `DeviceInfo` in the current scope","code":{"code":"E0599","explanation":"This error occurs when a method is used on a type which doesn't implement it:\n\nErroneous code example:\n\n```compile_fail,E0599\nstruct Mouth;\n\nlet x = Mouth;\nx.chocolate(); // error: no method named `chocolate` found for type `Mouth`\n // in the current scope\n```\n\nIn this case, you need to implement the `chocolate` method to fix the error:\n\n```\nstruct Mouth;\n\nimpl Mouth {\n fn chocolate(&self) { // We implement the `chocolate` method here.\n println!(\"Hmmm! I love chocolate!\");\n }\n}\n\nlet x = Mouth;\nx.chocolate(); // ok!\n```\n"},"level":"error","spans":[{"file_name":"src/ha/mod.rs","byte_start":3267,"byte_end":3272,"line_start":91,"line_end":91,"column_start":43,"column_end":48,"is_primary":true,"text":[{"text":" device: DeviceInfo { ..device.clone() },","highlight_start":43,"highlight_end":48}],"label":"method not found in `DeviceInfo`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/ha/mod.rs","byte_start":213,"byte_end":230,"line_start":9,"line_end":9,"column_start":1,"column_end":18,"is_primary":false,"text":[{"text":"struct DeviceInfo {","highlight_start":1,"highlight_end":18}],"label":"method `clone` not found for this struct","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"items from traits can only be used if the trait is implemented and in scope","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"the following trait defines an item `clone`, perhaps you need to implement it:\ncandidate #1: `Clone`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0599]\u001b[0m\u001b[1m: no method named `clone` found for struct `DeviceInfo` in the current scope\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ha/mod.rs:91:43\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m9\u001b[0m \u001b[1m\u001b[94m|\u001b[0m struct DeviceInfo {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m-----------------\u001b[0m \u001b[1m\u001b[94mmethod `clone` not found for this struct\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m91\u001b[0m \u001b[1m\u001b[94m|\u001b[0m device: DeviceInfo { ..device.clone() },\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^\u001b[0m \u001b[1m\u001b[91mmethod not found in `DeviceInfo`\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: items from traits can only be used if the trait is implemented and in scope\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: the following trait defines an item `clone`, perhaps you need to implement it:\n candidate #1: `Clone`\n\n"}
{"$message_type":"diagnostic","message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.\n\nErroneous code examples:\n\n```compile_fail,E0308\nfn plus_one(x: i32) -> i32 {\n x + 1\n}\n\nplus_one(\"Not a number\");\n// ^^^^^^^^^^^^^^ expected `i32`, found `&str`\n\nif \"Not a bool\" {\n// ^^^^^^^^^^^^ expected `bool`, found `&str`\n}\n\nlet x: f32 = \"Not a float\";\n// --- ^^^^^^^^^^^^^ expected `f32`, found `&str`\n// |\n// expected due to this\n```\n\nThis error occurs when an expression was used in a place where the compiler\nexpected an expression of a different type. It can occur in several cases, the\nmost common being when calling a function and passing an argument which has a\ndifferent type than the matching type in the function declaration.\n"},"level":"error","spans":[{"file_name":"src/runtime/mod.rs","byte_start":4041,"byte_end":4046,"line_start":103,"line_end":103,"column_start":21,"column_end":26,"is_primary":true,"text":[{"text":" break;","highlight_start":21,"highlight_end":26}],"label":"expected `Result<(), Error>`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":" expected enum `Result<(), anyhow::Error>`\nfound unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"give the `break` a value of the expected type","code":null,"level":"help","spans":[{"file_name":"src/runtime/mod.rs","byte_start":4046,"byte_end":4046,"line_start":103,"line_end":103,"column_start":26,"column_end":26,"is_primary":true,"text":[{"text":" break;","highlight_start":26,"highlight_end":26}],"label":null,"suggested_replacement":" Ok(())","suggestion_applicability":"HasPlaceholders","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0308]\u001b[0m\u001b[1m: mismatched types\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:103:21\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m103\u001b[0m \u001b[1m\u001b[94m|\u001b[0m break;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^\u001b[0m \u001b[1m\u001b[91mexpected `Result<(), Error>`, found `()`\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: expected enum `\u001b[1m\u001b[35mResult<(), anyhow::Error>\u001b[0m`\n found unit type `\u001b[1m\u001b[35m()\u001b[0m`\n\u001b[1m\u001b[96mhelp\u001b[0m: give the `break` a value of the expected type\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m103\u001b[0m \u001b[1m\u001b[94m| \u001b[0m break\u001b[92m Ok(())\u001b[0m;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[92m++++++\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"`rumqttc::EventLoop` doesn't implement `Debug`","code":{"code":"E0277","explanation":"You tried to use a type which doesn't implement some trait in a place which\nexpected that trait.\n\nErroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n foo.bar();\n}\n\nfn main() {\n // we now call the method with the i32 type, which doesn't implement\n // the Foo trait\n some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n fn bar(&self);\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n fn bar(&self) {}\n}\n\nfn some_func<T: Foo>(foo: T) {\n foo.bar(); // we can now use this method since i32 implements the\n // Foo trait\n}\n\nfn main() {\n some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n // implemented for the type `T`\n}\n\nfn main() {\n // We now call the method with the i32 type,\n // which *does* implement the Debug trait.\n some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function. Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function. It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\nuse std::fmt;\n\n// Restrict the input type to types that implement Debug.\nfn some_func<T: fmt::Debug>(foo: T) {\n println!(\"{:?}\", foo);\n}\n\nfn main() {\n // Calling the method is still fine, as i32 implements Debug.\n some_func(5i32);\n\n // This would fail to compile now:\n // struct WithoutDebug;\n // some_func(WithoutDebug);\n}\n```\n\nRust only looks at the signature of the called function, as such it must\nalready specify all requirements that will be used for every type parameter.\n"},"level":"error","spans":[{"file_name":"src/mqtt/mod.rs","byte_start":341,"byte_end":366,"line_start":12,"line_end":12,"column_start":5,"column_end":30,"is_primary":true,"text":[{"text":" pub event_loop: EventLoop,","highlight_start":5,"highlight_end":30}],"label":"the trait `Debug` is not implemented for `rumqttc::EventLoop`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/mqtt/mod.rs","byte_start":269,"byte_end":274,"line_start":9,"line_end":9,"column_start":10,"column_end":15,"is_primary":false,"text":[{"text":"#[derive(Debug, Clone)]","highlight_start":10,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[derive(Debug)]","def_site_span":{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/fmt/mod.rs","byte_start":34336,"byte_end":34351,"line_start":913,"line_end":913,"column_start":5,"column_end":20,"is_primary":false,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: `rumqttc::EventLoop` doesn't implement `Debug`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/mqtt/mod.rs:12:5\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m9\u001b[0m \u001b[1m\u001b[94m|\u001b[0m #[derive(Debug, Clone)]\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m-----\u001b[0m \u001b[1m\u001b[94min this derive macro expansion\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m12\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub event_loop: EventLoop,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m \u001b[1m\u001b[91mthe trait `Debug` is not implemented for `rumqttc::EventLoop`\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"the trait bound `rumqttc::EventLoop: Clone` is not satisfied","code":{"code":"E0277","explanation":"You tried to use a type which doesn't implement some trait in a place which\nexpected that trait.\n\nErroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n foo.bar();\n}\n\nfn main() {\n // we now call the method with the i32 type, which doesn't implement\n // the Foo trait\n some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n fn bar(&self);\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n fn bar(&self) {}\n}\n\nfn some_func<T: Foo>(foo: T) {\n foo.bar(); // we can now use this method since i32 implements the\n // Foo trait\n}\n\nfn main() {\n some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n // implemented for the type `T`\n}\n\nfn main() {\n // We now call the method with the i32 type,\n // which *does* implement the Debug trait.\n some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function. Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function. It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\nuse std::fmt;\n\n// Restrict the input type to types that implement Debug.\nfn some_func<T: fmt::Debug>(foo: T) {\n println!(\"{:?}\", foo);\n}\n\nfn main() {\n // Calling the method is still fine, as i32 implements Debug.\n some_func(5i32);\n\n // This would fail to compile now:\n // struct WithoutDebug;\n // some_func(WithoutDebug);\n}\n```\n\nRust only looks at the signature of the called function, as such it must\nalready specify all requirements that will be used for every type parameter.\n"},"level":"error","spans":[{"file_name":"src/mqtt/mod.rs","byte_start":341,"byte_end":366,"line_start":12,"line_end":12,"column_start":5,"column_end":30,"is_primary":true,"text":[{"text":" pub event_loop: EventLoop,","highlight_start":5,"highlight_end":30}],"label":"the trait `Clone` is not implemented for `rumqttc::EventLoop`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/mqtt/mod.rs","byte_start":276,"byte_end":281,"line_start":9,"line_end":9,"column_start":17,"column_end":22,"is_primary":false,"text":[{"text":"#[derive(Debug, Clone)]","highlight_start":17,"highlight_end":22}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[derive(Clone)]","def_site_span":{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/clone.rs","byte_start":9498,"byte_end":9513,"line_start":257,"line_end":257,"column_start":1,"column_end":16,"is_primary":false,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the trait bound `rumqttc::EventLoop: Clone` is not satisfied\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/mqtt/mod.rs:12:5\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m9\u001b[0m \u001b[1m\u001b[94m|\u001b[0m #[derive(Debug, Clone)]\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m-----\u001b[0m \u001b[1m\u001b[94min this derive macro expansion\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m12\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub event_loop: EventLoop,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m \u001b[1m\u001b[91mthe trait `Clone` is not implemented for `rumqttc::EventLoop`\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"aborting due to 7 previous errors; 1 warning emitted","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[1m\u001b[91merror\u001b[0m\u001b[1m: aborting due to 7 previous errors; 1 warning emitted\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"Some errors have detailed explanations: E0277, E0308, E0432, E0433, E0599.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[1mSome errors have detailed explanations: E0277, E0308, E0432, E0433, E0599.\u001b[0m\n"}
{"$message_type":"diagnostic","message":"For more information about an error, try `rustc --explain E0277`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[1mFor more information about an error, try `rustc --explain E0277`.\u001b[0m\n"}