MCPcopy Create free account
hub / github.com/bnjbvr/trinity / init

Method init

modules/libcommand/src/lib.rs:41–52  ·  view source on GitHub ↗
(config: Option<Vec<(String, String)>>)

Source from the content-addressed store, hash-verified

39// Implement `TrinityCommand`, and get an implementation of `Guest` for free!
40impl<T: TrinityCommand> module::messaging::Guest for T {
41 fn init(config: Option<Vec<(String, String)>>) {
42 // Convert the Vec of tuples to a HashMap for convenience.
43 let config = match config {
44 Some(cfg) => cfg
45 .iter()
46 .map(|(k, v)| (k.to_string(), v.to_string()))
47 .collect(),
48 None => HashMap::new(),
49 };
50
51 Self::init(config);
52 }
53
54 fn help(topic: Option<String>) -> String {
55 Self::on_help(topic.as_deref())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected