aerocontext-core 0.4.1

Provider-neutral aeronautical-context model and the pluggable ContextProvider contract
Documentation
//! The control-command capability.
//!
//! Stub: the trait and its payloads exist so a tasking/control source can be
//! added later as a sibling capability, but no adapter implements it yet.

use async_trait::async_trait;

use crate::provider::{ContextProvider, ProviderError};

/// A control command directed at a provider (e.g. tasking a sensor).
///
/// Placeholder; `#[non_exhaustive]` so variants/fields can be added later
/// without breaking implementors.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
pub struct ControlCommand {}

/// Acknowledgement of a submitted [`ControlCommand`]. Placeholder.
#[derive(Debug, Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommandAck {}

/// A provider that accepts control commands — a sibling capability to
/// [`crate::WeatherBriefingProvider`] under the same [`ContextProvider`]
/// identity.
#[async_trait(?Send)]
pub trait ControlCommandProvider: ContextProvider {
    /// Submit a control command and await its acknowledgement.
    async fn submit_command(&self, command: &ControlCommand) -> Result<CommandAck, ProviderError>;
}