Skip to main content

aerocontext_core/
command.rs

1//! The control-command capability.
2//!
3//! Stub: the trait and its payloads exist so a tasking/control source can be
4//! added later as a sibling capability, but no adapter implements it yet.
5
6use async_trait::async_trait;
7
8use crate::provider::{ContextProvider, ProviderError};
9
10/// A control command directed at a provider (e.g. tasking a sensor).
11///
12/// Placeholder; `#[non_exhaustive]` so variants/fields can be added later
13/// without breaking implementors.
14#[derive(Debug, Clone, PartialEq)]
15#[non_exhaustive]
16pub struct ControlCommand {}
17
18/// Acknowledgement of a submitted [`ControlCommand`]. Placeholder.
19#[derive(Debug, Clone, Default, PartialEq)]
20#[non_exhaustive]
21pub struct CommandAck {}
22
23/// A provider that accepts control commands — a sibling capability to
24/// [`crate::WeatherBriefingProvider`] under the same [`ContextProvider`]
25/// identity.
26#[async_trait(?Send)]
27pub trait ControlCommandProvider: ContextProvider {
28    /// Submit a control command and await its acknowledgement.
29    async fn submit_command(&self, command: &ControlCommand) -> Result<CommandAck, ProviderError>;
30}