Add derive to stdin_echo example
use async_trait::async_trait;
use clap::App;
use jormungandr_watchdog::{
- service, CoreServices, Service, ServiceIdentifier, ServiceState, WatchdogBuilder,
+ service, CoreServices, IntercomMsg, Service, ServiceIdentifier, ServiceState, WatchdogBuilder,
};
use tokio::{
io::{stdin, stdout, AsyncBufReadExt as _, AsyncWriteExt as _, BufReader},
@@ -16,11 +16,9 @@ struct StdoutWriter {
state: ServiceState<Self>,
}
-#[derive(Debug)]
+#[derive(Debug, IntercomMsg)]
struct WriteMsg(String);
-impl service::IntercomMsg for WriteMsg {}
-
#[async_trait]
impl Service for StdinReader {
const SERVICE_IDENTIFIER: ServiceIdentifier = "stdin";
