use rkyv::{Archive, Deserialize, Serialize};
use mt_sea::Sendable;
#[derive(Archive, Serialize, Deserialize, Copy, Clone)]
pub struct InternalActionServerStateRequest {}
#[derive(Archive, Serialize, Deserialize, Copy, Clone)]
pub enum InternalActionServerStateResponse {
Starting,
Ready,
Broken,
}
#[derive(Archive, Serialize, Deserialize, Copy, Clone, Debug, PartialEq)]
pub enum GoalState {
InvalidGoalID,
Accepted,
Executing,
Canceling,
Succeeded,
Aborted,
Canceled,
}
#[derive(Archive, Serialize, Deserialize, Copy, Clone, Debug)]
pub enum CancelGoalRequestState {
Ok,
Rejected,
InvalidGoalID,
}
#[derive(Archive, Serialize, Deserialize, Copy, Clone, Debug)]
pub struct GoalStatus {
pub id: u64,
pub accepted: u128,
pub state: GoalState,
}
#[derive(Archive, Serialize, Deserialize, Clone, Debug)]
pub struct ActionStatusMsg {
pub goals: Vec<GoalStatus>,
}
#[derive(Archive, Serialize, Deserialize, Clone)]
pub struct ActionFeedbackMsg<T: Sendable + Clone> {
pub id: u64,
pub msg: T,
}
#[derive(Archive, Serialize, Deserialize, Clone)]
pub struct ActionSendGoalRequest<T: Sendable + Clone> {
pub id: u64,
pub goal: T,
}
#[derive(Archive, Serialize, Deserialize, Debug, Clone)]
pub struct ActionSendGoalResponse {
pub accepted: bool,
pub time: Option<u128>,
}
#[derive(Archive, Serialize, Deserialize, Clone)]
pub struct ActionCancelGoalRequest {
pub id: Option<u64>,
pub time: Option<u128>,
}
#[derive(Archive, Serialize, Deserialize, Debug, Clone)]
pub struct ActionCancelGoalResponse {
pub status: CancelGoalRequestState,
pub goals: Vec<u64>,
}
#[derive(Archive, Serialize, Deserialize, Debug, Clone)]
pub struct ActionGetResultRequest {
pub id: u64,
}
#[derive(Archive, Serialize, Deserialize, Debug, Clone)]
pub struct ActionGetResultResponse<T: Sendable + Clone> {
pub status: GoalState,
pub result: Option<T>,
}