MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / table

Method table

src/mcp/tools/render.rs:342–354  ·  view source on GitHub ↗
(&mut self, headers: &[&str], rows: &[Vec<String>])

Source from the content-addressed store, hash-verified

340 }
341
342 pub(super) fn table(&mut self, headers: &[&str], rows: &[Vec<String>]) -> &mut Self {
343 if headers.is_empty() {
344 return self;
345 }
346 let _ = writeln!(self.buf, "| {} |", headers.join(" | "));
347 let sep: Vec<&str> = headers.iter().map(|_| "---").collect();
348 let _ = writeln!(self.buf, "| {} |", sep.join(" | "));
349 for row in rows {
350 let cells: Vec<String> = row.iter().map(|c| esc_cell(c)).collect();
351 let _ = writeln!(self.buf, "| {} |", cells.join(" | "));
352 }
353 self
354 }
355
356 pub(super) fn code(&mut self, lang: &str, body: &str) -> &mut Self {
357 let _ = writeln!(self.buf, "```{lang}");

Callers 8

table_escapes_pipesFunction · 0.80
render_status_mdFunction · 0.80
render_simplify_couplingFunction · 0.80
render_outline_mdFunction · 0.80

Calls 3

esc_cellFunction · 0.85
collectMethod · 0.80
is_emptyMethod · 0.45

Tested by 1

table_escapes_pipesFunction · 0.64