pub trait Collector {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn snapshot(&self, ctx: &Context) -> Json;
// Provided methods
fn actions(&self) -> Vec<ActionSpec> { ... }
fn mutates(&self, action: &str, _args: &Json) -> Option<bool> { ... }
fn destructive(&self, _action: &str, _args: &Json) -> bool { ... }
fn call(
&mut self,
_ctx: &Context,
action: &str,
_args: &Json,
_origin: &Origin,
) -> Result<Json, String> { ... }
fn schemas(&self, _action: &str) -> Schemas { ... }
}Expand description
A part of the application, seen by the bridge.
Required Methods§
fn name(&self) -> &str
fn description(&self) -> &str
fn snapshot(&self, ctx: &Context) -> Json
Provided Methods§
fn actions(&self) -> Vec<ActionSpec>
Sourcefn mutates(&self, action: &str, _args: &Json) -> Option<bool>
fn mutates(&self, action: &str, _args: &Json) -> Option<bool>
Whether this call of an action changes the application: its
mutates, unless the action says per call (commands.run of a
read-only command does not). None: no such action.
Sourcefn destructive(&self, _action: &str, _args: &Json) -> bool
fn destructive(&self, _action: &str, _args: &Json) -> bool
Whether this call of an action destroys or discards what cannot
easily be had back (commands.run of a destructive command): an
agent’s call then waits for the user to confirm it (the agent
socket asks). false by default, and for an unknown action.