pub struct AgentCommand {
pub command_id: String,
pub requested_at_ms: i64,
pub kind: String,
pub params: String,
}Expand description
网关下发给 agent 的一次性命令。
与「期望状态」(工作 / 上送 / 策略)刻意分开:那些是可重拉的幂等快照,
这里是一次执行的动作,有明确的 command_id、结果与去重语义。
command_id 是去重键:agent 把处理过的命令写进本地台账,网关在没有收到
command_acks 时会重发同一条;agent 见到同一个 id 不重复跑,只补结果。
Fields§
§command_id: String§requested_at_ms: i64网关受理时刻(墙钟毫秒):agent 用它判过期。
kind: String命令词表(见 command_kind)。开放字符串:未知值由 agent 回
unsupported,而不是让整份回执解析失败。
params: String命令参数(JSON 文本;空 = 无参数)。不同 kind 自己解析,未知字段不进入本层。
Trait Implementations§
Source§impl Clone for AgentCommand
impl Clone for AgentCommand
Source§impl Debug for AgentCommand
impl Debug for AgentCommand
Source§impl<'de> Deserialize<'de> for AgentCommand
impl<'de> Deserialize<'de> for AgentCommand
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AgentCommand
Source§impl PartialEq for AgentCommand
impl PartialEq for AgentCommand
Source§impl Serialize for AgentCommand
impl Serialize for AgentCommand
impl StructuralPartialEq for AgentCommand
Auto Trait Implementations§
impl Freeze for AgentCommand
impl RefUnwindSafe for AgentCommand
impl Send for AgentCommand
impl Sync for AgentCommand
impl Unpin for AgentCommand
impl UnsafeUnpin for AgentCommand
impl UnwindSafe for AgentCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more