modular-agent-kit 0.21.0

Modular Agent Kit
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{AgentDefinition, MAK};

/// Registration entry emitted by the `#[modular_agent]` macro.
pub struct AgentRegistration {
    pub build: fn() -> AgentDefinition,
}

inventory::collect!(AgentRegistration);

/// Register all agents collected via the `#[modular_agent]` macro.
pub fn register_inventory_agents(mak: &MAK) {
    for reg in inventory::iter::<AgentRegistration> {
        mak.register_agent_definiton((reg.build)());
    }
}