MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / visibility_of

Method visibility_of

codegraph-kernel/src/rustlang.rs:392–399  ·  view source on GitHub ↗

rustExtractor.getVisibility: direct `visibility_modifier` child whose text contains `pub` → public, else private; none → private.

(&self, node: Node)

Source from the content-addressed store, hash-verified

390 /// rustExtractor.getVisibility: direct `visibility_modifier` child whose
391 /// text contains `pub` → public, else private; none → private.
392 fn visibility_of(&self, node: Node) -> u8 {
393 for c in node.children(&mut node.walk()) {
394 if c.kind() == "visibility_modifier" {
395 return if self.text(c).contains("pub") { 1 } else { 2 };
396 }
397 }
398 2 // private — Rust defaults to private
399 }
400
401 /// extractRustReturnType (languages/rust.ts:14).
402 fn return_type_of(&self, node: Node) -> Option<String> {

Callers 4

extract_fn_or_methodMethod · 0.45
extract_aggregateMethod · 0.45
extract_enumMethod · 0.45
extract_type_aliasMethod · 0.45

Calls 3

childrenMethod · 0.80
textMethod · 0.65
walkMethod · 0.45

Tested by

no test coverage detected