MCPcopy Create free account
hub / github.com/dfinity/ic-repl / match_method

Method match_method

src/helper.rs:57–72  ·  view source on GitHub ↗
(&self, meth: &str)

Source from the content-addressed store, hash-verified

55}
56impl CanisterInfo {
57 pub fn match_method(&self, meth: &str) -> Vec<Pair> {
58 self.methods
59 .iter()
60 .filter(|(name, _)| name.starts_with(meth))
61 .map(|(meth, func)| {
62 let mut replacement = format!(".{meth}(");
63 if func.args.is_empty() {
64 replacement.push(')');
65 }
66 Pair {
67 display: format!("{meth} : {func}"),
68 replacement,
69 }
70 })
71 .collect()
72 }
73}
74
75#[derive(Helper)]

Callers 1

completeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected