memfault_ssf/system_messages.rs
1//
2// Copyright (c) Memfault, Inc.
3// See License.txt for details
4use crate::{Handler, Message, Service};
5
6/// The `ShutdownServiceMessage` is supported by all services. It terminates the
7/// thread. No other message in the queue will be processed.
8/// The service will receive this message and can do something before shutting
9/// down.
10pub struct ShutdownServiceMessage {}
11impl Message for ShutdownServiceMessage {
12 type Reply = ();
13}
14
15impl<S: Service> Handler<ShutdownServiceMessage> for S {
16 fn deliver(&mut self, _m: ShutdownServiceMessage) {}
17}
18
19/// The `PingMessage` is supported by all services. It allows the caller to
20/// verify that the service is still running and that it has processed its
21/// queue.
22pub struct PingMessage {}
23impl Message for PingMessage {
24 type Reply = ();
25}
26
27impl<S: Service> Handler<PingMessage> for S {
28 fn deliver(&mut self, _m: PingMessage) {}
29}