MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / build_struct_signature

Method build_struct_signature

atomic-semantic/src/parsers/rust.rs:429–446  ·  view source on GitHub ↗

Build a struct signature string.

(&self, node: &Node, source: &str)

Source from the content-addressed store, hash-verified

427
428 /// Build a struct signature string.
429 fn build_struct_signature(&self, node: &Node, source: &str) -> Option<String> {
430 let name_node = node.child_by_field_name("name")?;
431 let name = self.node_text(&name_node, source);
432
433 // Check for generic type parameters
434 let generics = node
435 .child_by_field_name("type_parameters")
436 .map(|n| self.node_text(&n, source))
437 .unwrap_or_default();
438
439 let prefix = if self.is_pub(node) {
440 "pub struct"
441 } else {
442 "struct"
443 };
444
445 Some(format!("{} {}{}", prefix, name, generics))
446 }
447
448 /// Build a trait signature string.
449 fn build_trait_signature(&self, node: &Node, source: &str) -> Option<String> {

Callers 1

extract_structMethod · 0.80

Calls 2

is_pubMethod · 0.80
node_textMethod · 0.45

Tested by

no test coverage detected