Files
pilot/pilot-v2/target/debug/.fingerprint/pilot-v2-a6bd0095b73eec16/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

33 lines
356 KiB
Plaintext

{"$message_type":"diagnostic","message":"failed to resolve: could not find `mpsc` in `sync`","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":1626,"byte_end":1630,"line_start":53,"line_end":53,"column_start":49,"column_end":53,"is_primary":true,"text":[{"text":" let (cmd_tx, mut cmd_rx) = tokio::sync::mpsc::unbounded_channel();","highlight_start":49,"highlight_end":53}],"label":"could not find `mpsc` in `sync`","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":10362,"byte_end":10378,"line_start":452,"line_end":452,"column_start":19,"column_end":35,"is_primary":false,"text":[{"text":" #[cfg(feature = \"sync\")]","highlight_start":19,"highlight_end":35}],"label":"the item is gated behind the `sync` 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/sync/mod.rs","byte_start":15699,"byte_end":16960,"line_start":452,"line_end":498,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"cfg_sync! {","highlight_start":1,"highlight_end":1},{"text":" /// Named future types.","highlight_start":1,"highlight_end":1},{"text":" pub mod futures {","highlight_start":1,"highlight_end":1},{"text":" pub use super::notify::{Notified, OwnedNotified};","highlight_start":1,"highlight_end":1},{"text":" }","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" mod barrier;","highlight_start":1,"highlight_end":1},{"text":" pub use barrier::{Barrier, BarrierWaitResult};","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" pub mod broadcast;","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" pub mod mpsc;","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" mod mutex;","highlight_start":1,"highlight_end":1},{"text":" pub use mutex::{Mutex, MutexGuard, TryLockError, OwnedMutexGuard, MappedMutexGuard, OwnedMappedMutexGuard};","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" pub(crate) mod notify;","highlight_start":1,"highlight_end":1},{"text":" pub use notify::Notify;","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" pub mod oneshot;","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" pub(crate) mod batch_semaphore;","highlight_start":1,"highlight_end":1},{"text":" pub use batch_semaphore::{AcquireError, TryAcquireError};","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" mod semaphore;","highlight_start":1,"highlight_end":1},{"text":" pub use semaphore::{Semaphore, SemaphorePermit, OwnedSemaphorePermit};","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" mod rwlock;","highlight_start":1,"highlight_end":1},{"text":" pub use rwlock::RwLock;","highlight_start":1,"highlight_end":1},{"text":" pub use rwlock::owned_read_guard::OwnedRwLockReadGuard;","highlight_start":1,"highlight_end":1},{"text":" pub use rwlock::owned_write_guard::OwnedRwLockWriteGuard;","highlight_start":1,"highlight_end":1},{"text":" pub use rwlock::owned_write_guard_mapped::OwnedRwLockMappedWriteGuard;","highlight_start":1,"highlight_end":1},{"text":" pub use rwlock::read_guard::RwLockReadGuard;","highlight_start":1,"highlight_end":1},{"text":" pub use rwlock::write_guard::RwLockWriteGuard;","highlight_start":1,"highlight_end":1},{"text":" pub use rwlock::write_guard_mapped::RwLockMappedWriteGuard;","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" mod task;","highlight_start":1,"highlight_end":1},{"text":" pub(crate) use task::AtomicWaker;","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" mod once_cell;","highlight_start":1,"highlight_end":1},{"text":" pub use self::once_cell::{OnceCell, SetError};","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" mod set_once;","highlight_start":1,"highlight_end":1},{"text":" pub use self::set_once::{SetOnce, SetOnceError};","highlight_start":1,"highlight_end":1},{"text":"","highlight_start":1,"highlight_end":1},{"text":" pub mod watch;","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_sync!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/cfg.rs","byte_start":10283,"byte_end":10304,"line_start":449,"line_end":449,"column_start":1,"column_end":22,"is_primary":false,"text":[{"text":"macro_rules! cfg_sync {","highlight_start":1,"highlight_end":22}],"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/sync/mod.rs","byte_start":15931,"byte_end":15935,"line_start":463,"line_end":463,"column_start":13,"column_end":17,"is_primary":true,"text":[{"text":" pub mod mpsc;","highlight_start":13,"highlight_end":17}],"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 `mpsc` in `sync`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:53:49\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m53\u001b[0m \u001b[1m\u001b[94m|\u001b[0m let (cmd_tx, mut cmd_rx) = tokio::sync::mpsc::unbounded_channel();\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^\u001b[0m \u001b[1m\u001b[91mcould not find `mpsc` in `sync`\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/sync/mod.rs:463:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m452\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m/\u001b[0m cfg_sync! {\n\u001b[1m\u001b[94m453\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m /// Named future types.\n\u001b[1m\u001b[94m454\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub mod futures {\n\u001b[1m\u001b[94m455\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub use super::notify::{Notified, OwnedNotified};\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m463\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub mod mpsc;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[92m^^^^\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m497\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub mod watch;\n\u001b[1m\u001b[94m498\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 `sync` feature\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"module `sync` is private","code":{"code":"E0603","explanation":"A private item was used outside its scope.\n\nErroneous code example:\n\n```compile_fail,E0603\nmod foo {\n const PRIVATE: u32 = 0x_a_bad_1dea_u32; // This const is private, so we\n // can't use it outside of the\n // `foo` module.\n}\n\nprintln!(\"const value: {}\", foo::PRIVATE); // error: constant `PRIVATE`\n // is private\n```\n\nIn order to fix this error, you need to make the item public by using the `pub`\nkeyword. Example:\n\n```\nmod foo {\n pub const PRIVATE: u32 = 0x_a_bad_1dea_u32; // We set it public by using the\n // `pub` keyword.\n}\n\nprintln!(\"const value: {}\", foo::PRIVATE); // ok!\n```\n"},"level":"error","spans":[{"file_name":"src/runtime/mod.rs","byte_start":1620,"byte_end":1624,"line_start":53,"line_end":53,"column_start":43,"column_end":47,"is_primary":true,"text":[{"text":" let (cmd_tx, mut cmd_rx) = tokio::sync::mpsc::unbounded_channel();","highlight_start":43,"highlight_end":47}],"label":"private module","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the module `sync` is defined here","code":null,"level":"note","spans":[{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/lib.rs","byte_start":20443,"byte_end":20451,"line_start":555,"line_end":555,"column_start":5,"column_end":13,"is_primary":true,"text":[{"text":" mod sync;","highlight_start":5,"highlight_end":13}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0603]\u001b[0m\u001b[1m: module `sync` is private\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:53:43\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m53\u001b[0m \u001b[1m\u001b[94m|\u001b[0m let (cmd_tx, mut cmd_rx) = tokio::sync::mpsc::unbounded_channel();\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^\u001b[0m \u001b[1m\u001b[91mprivate module\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[92mnote\u001b[0m: the module `sync` is defined here\n \u001b[1m\u001b[94m--> \u001b[0m/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/lib.rs:555:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m555\u001b[0m \u001b[1m\u001b[94m|\u001b[0m mod sync;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[92m^^^^^^^^\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"type annotations needed","code":{"code":"E0282","explanation":"The compiler could not infer a type and asked for a type annotation.\n\nErroneous code example:\n\n```compile_fail,E0282\nlet x = Vec::new();\n```\n\nThis error indicates that type inference did not result in one unique possible\ntype, and extra information is required. In most cases this can be provided\nby adding a type annotation. Sometimes you need to specify a generic type\nparameter manually.\n\nIn the example above, type `Vec` has a type parameter `T`. When calling\n`Vec::new`, barring any other later usage of the variable `x` that allows the\ncompiler to infer what type `T` is, the compiler needs to be told what it is.\n\nThe type can be specified on the variable:\n\n```\nlet x: Vec<i32> = Vec::new();\n```\n\nThe type can also be specified in the path of the expression:\n\n```\nlet x = Vec::<i32>::new();\n```\n\nIn cases with more complex types, it is not necessary to annotate the full\ntype. Once the ambiguity is resolved, the compiler can infer the rest:\n\n```\nlet x: Vec<_> = \"hello\".chars().rev().collect();\n```\n\nAnother way to provide the compiler with enough information, is to specify the\ngeneric type parameter:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<char>>();\n```\n\nAgain, you need not specify the full type if the compiler can infer it:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<_>>();\n```\n\nApart from a method or function with a generic type parameter, this error can\noccur when a type parameter of a struct or trait cannot be inferred. In that\ncase it is not always possible to use a type annotation, because all candidates\nhave the same return type. For instance:\n\n```compile_fail,E0282\nstruct Foo<T> {\n num: T,\n}\n\nimpl<T> Foo<T> {\n fn bar() -> i32 {\n 0\n }\n\n fn baz() {\n let number = Foo::bar();\n }\n}\n```\n\nThis will fail because the compiler does not know which instance of `Foo` to\ncall `bar` on. Change `Foo::bar()` to `Foo::<T>::bar()` to resolve the error.\n"},"level":"error","spans":[{"file_name":"src/runtime/mod.rs","byte_start":1875,"byte_end":1881,"line_start":58,"line_end":58,"column_start":33,"column_end":39,"is_primary":true,"text":[{"text":" let _ = cmd_tx.send((publish.topic.to_string(), publish.payload.to_vec()));","highlight_start":33,"highlight_end":39}],"label":"cannot infer type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[91merror[E0282]\u001b[0m\u001b[1m: type annotations needed\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:58:33\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m58\u001b[0m \u001b[1m\u001b[94m|\u001b[0m let _ = cmd_tx.send((publish.topic.to_string(), publish.payload.to_vec()));\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^^\u001b[0m \u001b[1m\u001b[91mcannot infer type\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"type annotations needed","code":{"code":"E0282","explanation":"The compiler could not infer a type and asked for a type annotation.\n\nErroneous code example:\n\n```compile_fail,E0282\nlet x = Vec::new();\n```\n\nThis error indicates that type inference did not result in one unique possible\ntype, and extra information is required. In most cases this can be provided\nby adding a type annotation. Sometimes you need to specify a generic type\nparameter manually.\n\nIn the example above, type `Vec` has a type parameter `T`. When calling\n`Vec::new`, barring any other later usage of the variable `x` that allows the\ncompiler to infer what type `T` is, the compiler needs to be told what it is.\n\nThe type can be specified on the variable:\n\n```\nlet x: Vec<i32> = Vec::new();\n```\n\nThe type can also be specified in the path of the expression:\n\n```\nlet x = Vec::<i32>::new();\n```\n\nIn cases with more complex types, it is not necessary to annotate the full\ntype. Once the ambiguity is resolved, the compiler can infer the rest:\n\n```\nlet x: Vec<_> = \"hello\".chars().rev().collect();\n```\n\nAnother way to provide the compiler with enough information, is to specify the\ngeneric type parameter:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<char>>();\n```\n\nAgain, you need not specify the full type if the compiler can infer it:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<_>>();\n```\n\nApart from a method or function with a generic type parameter, this error can\noccur when a type parameter of a struct or trait cannot be inferred. In that\ncase it is not always possible to use a type annotation, because all candidates\nhave the same return type. For instance:\n\n```compile_fail,E0282\nstruct Foo<T> {\n num: T,\n}\n\nimpl<T> Foo<T> {\n fn bar() -> i32 {\n 0\n }\n\n fn baz() {\n let number = Foo::bar();\n }\n}\n```\n\nThis will fail because the compiler does not know which instance of `Foo` to\ncall `bar` on. Change `Foo::bar()` to `Foo::<T>::bar()` to resolve the error.\n"},"level":"error","spans":[{"file_name":"src/runtime/mod.rs","byte_start":5023,"byte_end":5029,"line_start":131,"line_end":131,"column_start":42,"column_end":48,"is_primary":true,"text":[{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":42,"highlight_end":48}],"label":"cannot infer type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[91merror[E0282]\u001b[0m\u001b[1m: type annotations needed\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:131:42\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m131\u001b[0m \u001b[1m\u001b[94m|\u001b[0m Some((topic, payload)) = cmd_rx.recv() => {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^^\u001b[0m \u001b[1m\u001b[91mcannot infer type\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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/runtime/mod.rs","byte_start":5004,"byte_end":5009,"line_start":131,"line_end":131,"column_start":23,"column_end":28,"is_primary":true,"text":[{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":23,"highlight_end":28}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"all local variables must have a statically known size","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:131:23\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m131\u001b[0m \u001b[1m\u001b[94m|\u001b[0m Some((topic, payload)) = cmd_rx.recv() => {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: all local variables must have a statically known size\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":28639,"byte_end":28671,"line_start":661,"line_end":661,"column_start":13,"column_end":45,"is_primary":true,"text":[{"text":" $crate::macros::support::poll_fn(|cx| {","highlight_start":13,"highlight_end":45}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"only the last element of a tuple may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: only the last element of a tuple may have a dynamically sized type\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/task/ready.rs","byte_start":1422,"byte_end":1449,"line_start":54,"line_end":54,"column_start":20,"column_end":47,"is_primary":true,"text":[],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":28874,"byte_end":28945,"line_start":664,"line_end":664,"column_start":17,"column_end":88,"is_primary":false,"text":[{"text":" ::std::task::ready!($crate::macros::support::poll_budget_available(cx));","highlight_start":17,"highlight_end":88}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"::std::task::ready!","def_site_span":{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/task/ready.rs","byte_start":1277,"byte_end":1292,"line_start":50,"line_end":50,"column_start":1,"column_end":16,"is_primary":false,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"only the last element of a tuple may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: only the last element of a tuple may have a dynamically sized type\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `::std::task::ready` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32437,"byte_end":32444,"line_start":738,"line_end":738,"column_start":21,"column_end":28,"is_primary":true,"text":[{"text":" Pending","highlight_start":21,"highlight_end":28}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"only the last element of a tuple may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: only the last element of a tuple may have a dynamically sized type\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32109,"byte_end":32114,"line_start":730,"line_end":730,"column_start":40,"column_end":45,"is_primary":true,"text":[{"text":" return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));","highlight_start":40,"highlight_end":45}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"only the last element of a tuple may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: only the last element of a tuple may have a dynamically sized type\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49212,"byte_end":49222,"line_start":1220,"line_end":1220,"column_start":11,"column_end":21,"is_primary":true,"text":[{"text":" $($p)::*::_0 $($t)*","highlight_start":11,"highlight_end":21}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32115,"byte_end":32177,"line_start":730,"line_end":730,"column_start":46,"column_end":108,"is_primary":false,"text":[{"text":" return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));","highlight_start":46,"highlight_end":108}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select_variant!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49132,"byte_end":49159,"line_start":1218,"line_end":1218,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"macro_rules! select_variant {","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"only the last element of a tuple may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: only the last element of a tuple may have a dynamically sized type\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select_variant` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32546,"byte_end":32551,"line_start":741,"line_end":741,"column_start":21,"column_end":26,"is_primary":true,"text":[{"text":" Ready(__tokio_select_util::Out::Disabled)","highlight_start":21,"highlight_end":26}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"only the last element of a tuple may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: only the last element of a tuple may have a dynamically sized type\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32552,"byte_end":32586,"line_start":741,"line_end":741,"column_start":27,"column_end":61,"is_primary":true,"text":[{"text":" Ready(__tokio_select_util::Out::Disabled)","highlight_start":27,"highlight_end":61}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"only the last element of a tuple may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: only the last element of a tuple may have a dynamically sized type\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49288,"byte_end":49298,"line_start":1223,"line_end":1223,"column_start":11,"column_end":21,"is_primary":true,"text":[{"text":" $($p)::*::_1 $($t)*","highlight_start":11,"highlight_end":21}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32115,"byte_end":32177,"line_start":730,"line_end":730,"column_start":46,"column_end":108,"is_primary":false,"text":[{"text":" return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));","highlight_start":46,"highlight_end":108}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select_variant!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49132,"byte_end":49159,"line_start":1218,"line_end":1218,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"macro_rules! select_variant {","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"only the last element of a tuple may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: only the last element of a tuple may have a dynamically sized type\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select_variant` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49446,"byte_end":49456,"line_start":1229,"line_end":1229,"column_start":11,"column_end":21,"is_primary":true,"text":[{"text":" $($p)::*::_3 $($t)*","highlight_start":11,"highlight_end":21}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32115,"byte_end":32177,"line_start":730,"line_end":730,"column_start":46,"column_end":108,"is_primary":false,"text":[{"text":" return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));","highlight_start":46,"highlight_end":108}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select_variant!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49132,"byte_end":49159,"line_start":1218,"line_end":1218,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"macro_rules! select_variant {","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"only the last element of a tuple may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: only the last element of a tuple may have a dynamically sized type\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select_variant` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49366,"byte_end":49376,"line_start":1226,"line_end":1226,"column_start":11,"column_end":21,"is_primary":true,"text":[{"text":" $($p)::*::_2 $($t)*","highlight_start":11,"highlight_end":21}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32115,"byte_end":32177,"line_start":730,"line_end":730,"column_start":46,"column_end":108,"is_primary":false,"text":[{"text":" return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));","highlight_start":46,"highlight_end":108}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select_variant!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49132,"byte_end":49159,"line_start":1218,"line_end":1218,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"macro_rules! select_variant {","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"only the last element of a tuple may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: only the last element of a tuple may have a dynamically sized type\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select_variant` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `str` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":30935,"byte_end":30956,"line_start":707,"line_end":707,"column_start":49,"column_end":70,"is_primary":true,"text":[{"text":" let out = match Future::poll(fut, cx) {","highlight_start":49,"highlight_end":70}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the trait `Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"only the last element of a tuple may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `str` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `str`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: only the last element of a tuple may have a dynamically sized type\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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/runtime/mod.rs","byte_start":5011,"byte_end":5018,"line_start":131,"line_end":131,"column_start":30,"column_end":37,"is_primary":true,"text":[{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":30,"highlight_end":37}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"all local variables must have a statically known size","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:131:30\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m131\u001b[0m \u001b[1m\u001b[94m|\u001b[0m Some((topic, payload)) = cmd_rx.recv() => {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^^^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: all local variables must have a statically known size\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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/runtime/mod.rs","byte_start":4998,"byte_end":5020,"line_start":131,"line_end":131,"column_start":17,"column_end":39,"is_primary":true,"text":[{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":17,"highlight_end":39}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by a bound in `std::prelude::v1::Some`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24322,"byte_end":24326,"line_start":607,"line_end":607,"column_start":5,"column_end":9,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:131:17\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m131\u001b[0m \u001b[1m\u001b[94m|\u001b[0m Some((topic, payload)) = cmd_rx.recv() => {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m^^^^^^^^^^^^^^^^^^^^^^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by a bound in `std::prelude::v1::Some`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:607:5\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":28639,"byte_end":28671,"line_start":661,"line_end":661,"column_start":13,"column_end":45,"is_primary":true,"text":[{"text":" $crate::macros::support::poll_fn(|cx| {","highlight_start":13,"highlight_end":45}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by an implicit `Sized` bound in `std::option::Option`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24095,"byte_end":24113,"line_start":599,"line_end":599,"column_start":1,"column_end":19,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by an implicit `Sized` bound in `std::option::Option`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:599:1\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/task/ready.rs","byte_start":1422,"byte_end":1449,"line_start":54,"line_end":54,"column_start":20,"column_end":47,"is_primary":true,"text":[],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":28874,"byte_end":28945,"line_start":664,"line_end":664,"column_start":17,"column_end":88,"is_primary":false,"text":[{"text":" ::std::task::ready!($crate::macros::support::poll_budget_available(cx));","highlight_start":17,"highlight_end":88}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"::std::task::ready!","def_site_span":{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/task/ready.rs","byte_start":1277,"byte_end":1292,"line_start":50,"line_end":50,"column_start":1,"column_end":16,"is_primary":false,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by an implicit `Sized` bound in `std::option::Option`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24095,"byte_end":24113,"line_start":599,"line_end":599,"column_start":1,"column_end":19,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by an implicit `Sized` bound in `std::option::Option`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:599:1\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `::std::task::ready` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32437,"byte_end":32444,"line_start":738,"line_end":738,"column_start":21,"column_end":28,"is_primary":true,"text":[{"text":" Pending","highlight_start":21,"highlight_end":28}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by an implicit `Sized` bound in `std::option::Option`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24095,"byte_end":24113,"line_start":599,"line_end":599,"column_start":1,"column_end":19,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by an implicit `Sized` bound in `std::option::Option`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:599:1\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32109,"byte_end":32114,"line_start":730,"line_end":730,"column_start":40,"column_end":45,"is_primary":true,"text":[{"text":" return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));","highlight_start":40,"highlight_end":45}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by an implicit `Sized` bound in `std::option::Option`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24095,"byte_end":24113,"line_start":599,"line_end":599,"column_start":1,"column_end":19,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by an implicit `Sized` bound in `std::option::Option`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:599:1\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49212,"byte_end":49222,"line_start":1220,"line_end":1220,"column_start":11,"column_end":21,"is_primary":true,"text":[{"text":" $($p)::*::_0 $($t)*","highlight_start":11,"highlight_end":21}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32115,"byte_end":32177,"line_start":730,"line_end":730,"column_start":46,"column_end":108,"is_primary":false,"text":[{"text":" return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));","highlight_start":46,"highlight_end":108}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select_variant!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49132,"byte_end":49159,"line_start":1218,"line_end":1218,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"macro_rules! select_variant {","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by an implicit `Sized` bound in `std::option::Option`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24095,"byte_end":24113,"line_start":599,"line_end":599,"column_start":1,"column_end":19,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by an implicit `Sized` bound in `std::option::Option`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:599:1\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select_variant` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32546,"byte_end":32551,"line_start":741,"line_end":741,"column_start":21,"column_end":26,"is_primary":true,"text":[{"text":" Ready(__tokio_select_util::Out::Disabled)","highlight_start":21,"highlight_end":26}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by an implicit `Sized` bound in `std::option::Option`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24095,"byte_end":24113,"line_start":599,"line_end":599,"column_start":1,"column_end":19,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by an implicit `Sized` bound in `std::option::Option`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:599:1\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32552,"byte_end":32586,"line_start":741,"line_end":741,"column_start":27,"column_end":61,"is_primary":true,"text":[{"text":" Ready(__tokio_select_util::Out::Disabled)","highlight_start":27,"highlight_end":61}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by an implicit `Sized` bound in `std::option::Option`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24095,"byte_end":24113,"line_start":599,"line_end":599,"column_start":1,"column_end":19,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by an implicit `Sized` bound in `std::option::Option`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:599:1\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49288,"byte_end":49298,"line_start":1223,"line_end":1223,"column_start":11,"column_end":21,"is_primary":true,"text":[{"text":" $($p)::*::_1 $($t)*","highlight_start":11,"highlight_end":21}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32115,"byte_end":32177,"line_start":730,"line_end":730,"column_start":46,"column_end":108,"is_primary":false,"text":[{"text":" return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));","highlight_start":46,"highlight_end":108}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select_variant!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49132,"byte_end":49159,"line_start":1218,"line_end":1218,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"macro_rules! select_variant {","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by an implicit `Sized` bound in `std::option::Option`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24095,"byte_end":24113,"line_start":599,"line_end":599,"column_start":1,"column_end":19,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by an implicit `Sized` bound in `std::option::Option`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:599:1\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select_variant` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49446,"byte_end":49456,"line_start":1229,"line_end":1229,"column_start":11,"column_end":21,"is_primary":true,"text":[{"text":" $($p)::*::_3 $($t)*","highlight_start":11,"highlight_end":21}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32115,"byte_end":32177,"line_start":730,"line_end":730,"column_start":46,"column_end":108,"is_primary":false,"text":[{"text":" return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));","highlight_start":46,"highlight_end":108}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select_variant!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49132,"byte_end":49159,"line_start":1218,"line_end":1218,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"macro_rules! select_variant {","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by an implicit `Sized` bound in `std::option::Option`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24095,"byte_end":24113,"line_start":599,"line_end":599,"column_start":1,"column_end":19,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by an implicit `Sized` bound in `std::option::Option`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:599:1\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select_variant` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49366,"byte_end":49376,"line_start":1226,"line_end":1226,"column_start":11,"column_end":21,"is_primary":true,"text":[{"text":" $($p)::*::_2 $($t)*","highlight_start":11,"highlight_end":21}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":32115,"byte_end":32177,"line_start":730,"line_end":730,"column_start":46,"column_end":108,"is_primary":false,"text":[{"text":" return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));","highlight_start":46,"highlight_end":108}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select_variant!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":49132,"byte_end":49159,"line_start":1218,"line_end":1218,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"macro_rules! select_variant {","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by an implicit `Sized` bound in `std::option::Option`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24095,"byte_end":24113,"line_start":599,"line_end":599,"column_start":1,"column_end":19,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by an implicit `Sized` bound in `std::option::Option`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:599:1\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select_variant` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"the size for values of type `[u8]` cannot be known at compilation time","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":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":30935,"byte_end":30956,"line_start":707,"line_end":707,"column_start":49,"column_end":70,"is_primary":true,"text":[{"text":" let out = match Future::poll(fut, cx) {","highlight_start":49,"highlight_end":70}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33144,"byte_end":33251,"line_start":762,"line_end":762,"column_start":9,"column_end":116,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; $($t)*; panic!(\"all branches are disabled and there is no else branch\") })","highlight_start":9,"highlight_end":116}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":34152,"byte_end":34245,"line_start":777,"line_end":777,"column_start":9,"column_end":102,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if true => $h, } $($r)*)","highlight_start":9,"highlight_end":102}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":33945,"byte_end":34036,"line_start":774,"line_end":774,"column_start":9,"column_end":100,"is_primary":false,"text":[{"text":" $crate::select!(@{ start=$start; ($($s)* _) $($t)* ($($s)*) $p = $f, if $c => $h, } $($r)*)","highlight_start":9,"highlight_end":100}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":35459,"byte_end":35554,"line_start":805,"line_end":805,"column_start":9,"column_end":104,"is_primary":false,"text":[{"text":" $crate::select!(@{ start={ $crate::macros::support::thread_rng_n(BRANCHES) }; () } $p = $($t)*)","highlight_start":9,"highlight_end":104}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/runtime/mod.rs","byte_start":3910,"byte_end":5887,"line_start":112,"line_end":151,"column_start":13,"column_end":14,"is_primary":false,"text":[{"text":" tokio::select! {","highlight_start":13,"highlight_end":29},{"text":" _ = telemetry_tick.tick(), if telemetry.is_some() => {","highlight_start":1,"highlight_end":71},{"text":" let metrics = telemetry.as_mut().unwrap().read();","highlight_start":1,"highlight_end":70},{"text":" for (name, value) in metrics {","highlight_start":1,"highlight_end":51},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, &name, &value).await {","highlight_start":1,"highlight_end":108},{"text":" warn!(error = %err, \"publish state failed\");","highlight_start":1,"highlight_end":73},{"text":" }","highlight_start":1,"highlight_end":26},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = heartbeat_tick.tick() => {","highlight_start":1,"highlight_end":47},{"text":" let current = detect_power_state();","highlight_start":1,"highlight_end":56},{"text":" if let Err(err) = mqtt::publish_state(&client, &self.config, \"power_state\", &current).await {","highlight_start":1,"highlight_end":114},{"text":" warn!(error = %err, \"publish power_state failed\");","highlight_start":1,"highlight_end":75},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" let status = build_status(&self.config, self.start.elapsed().as_secs());","highlight_start":1,"highlight_end":93},{"text":" if let Err(err) = mqtt::publish_status(&client, &self.config, &status).await {","highlight_start":1,"highlight_end":99},{"text":" warn!(error = %err, \"publish status failed\");","highlight_start":1,"highlight_end":70},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" Some((topic, payload)) = cmd_rx.recv() => {","highlight_start":1,"highlight_end":60},{"text":" if let Err(err) = handle_command(","highlight_start":1,"highlight_end":54},{"text":" &client,","highlight_start":1,"highlight_end":33},{"text":" &self.config,","highlight_start":1,"highlight_end":38},{"text":" &mut last_exec,","highlight_start":1,"highlight_end":40},{"text":" &topic,","highlight_start":1,"highlight_end":32},{"text":" &payload,","highlight_start":1,"highlight_end":34},{"text":" ).await {","highlight_start":1,"highlight_end":30},{"text":" warn!(error = %err, \"command handling failed\");","highlight_start":1,"highlight_end":72},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" _ = &mut shutdown => {","highlight_start":1,"highlight_end":39},{"text":" if let Err(err) = mqtt::publish_availability(&client, &self.config, false).await {","highlight_start":1,"highlight_end":103},{"text":" warn!(error = %err, \"publish availability offline failed\");","highlight_start":1,"highlight_end":84},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" if let Err(err) = client.disconnect().await {","highlight_start":1,"highlight_end":66},{"text":" warn!(error = %err, \"mqtt disconnect failed\");","highlight_start":1,"highlight_end":71},{"text":" }","highlight_start":1,"highlight_end":22},{"text":" break Ok(());","highlight_start":1,"highlight_end":34},{"text":" }","highlight_start":1,"highlight_end":18},{"text":" }","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"tokio::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"$crate::select!","def_site_span":{"file_name":"/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.48.0/src/macros/select.rs","byte_start":24368,"byte_end":24387,"line_start":571,"line_end":571,"column_start":7,"column_end":26,"is_primary":false,"text":[{"text":"doc! {macro_rules! select {","highlight_start":7,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(str, [u8])`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by an implicit `Sized` bound in `std::option::Option`","code":null,"level":"note","spans":[{"file_name":"/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs","byte_start":24095,"byte_end":24113,"line_start":599,"line_end":599,"column_start":1,"column_end":19,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0277]\u001b[0m\u001b[1m: the size for values of type `[u8]` cannot be known at compilation time\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/runtime/mod.rs:112:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m112\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m/\u001b[0m tokio::select! {\n\u001b[1m\u001b[94m113\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m _ = telemetry_tick.tick(), if telemetry.is_some() => {\n\u001b[1m\u001b[94m114\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m let metrics = telemetry.as_mut().unwrap().read();\n\u001b[1m\u001b[94m115\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m for (name, value) in metrics {\n\u001b[1m\u001b[94m...\u001b[0m \u001b[1m\u001b[91m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|\u001b[0m }\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[91m|_____________^\u001b[0m \u001b[1m\u001b[91mdoesn't have a size known at compile-time\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: within `(str, [u8])`, the trait `Sized` is not implemented for `[u8]`\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required because it appears within the type `(str, [u8])`\n\u001b[1m\u001b[92mnote\u001b[0m: required by an implicit `Sized` bound in `std::option::Option`\n \u001b[1m\u001b[94m--> \u001b[0m/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/option.rs:599:1\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: this error originates in the macro `$crate::select` which comes from the expansion of the macro `tokio::select` (in Nightly builds, run with -Z macro-backtrace for more info)\n\n"}
{"$message_type":"diagnostic","message":"aborting due to 29 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[1m\u001b[91merror\u001b[0m\u001b[1m: aborting due to 29 previous errors\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"Some errors have detailed explanations: E0277, E0282, E0433, E0603.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[1mSome errors have detailed explanations: E0277, E0282, E0433, E0603.\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"}