rover_nexus_core 0.2.0

Wire-format message types (Cap'n Proto + JSON) for communication between robotic vehicles and a robot orchestration server: Rover Nexus
Documentation
// Copyright 2026 Rottinghaus Dynamics
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Rust domain types for settings query messages.

use serde::{Deserialize, Serialize};

use crate::core_model::Value;

/// Request to fetch settings from the robot agent.
///
/// If `keys` is empty, all settings are returned.
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GetSettingsRequest {
    /// Optional list of setting keys to fetch. If empty, returns all settings.
    #[serde(default)]
    pub keys: Vec<String>,
}

/// A single setting record with value and metadata.
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SettingItem {
    /// The setting key.
    pub key: String,
    /// The current value.
    pub value: Value,
    /// When this setting was last updated (unix ms).
    pub updated_at_ms: i64,
    /// Who last updated this setting (e.g., "robot", "fleet_manager").
    /// Empty string if not set.
    #[serde(default)]
    pub updated_by: String,
}

/// Response containing requested settings.
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GetSettingsResponse {
    /// The settings that were found.
    pub settings: Vec<SettingItem>,
    /// Keys that were requested but not found (only populated if specific keys were requested).
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub not_found: Vec<String>,
}