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

Method visibility_of

codegraph-kernel/src/rustlang.rs:373–382  ·  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

371 /// rustExtractor.getVisibility: direct `visibility_modifier` child whose
372 /// text contains `pub` → public, else private; none → private.
373 fn visibility_of(&self, node: Node) -> u8 {
374 for i in 0..node.child_count() {
375 if let Some(c) = node.child(i) {
376 if c.kind() == "visibility_modifier" {
377 return if self.text(c).contains("pub") { 1 } else { 2 };
378 }
379 }
380 }
381 2 // private — Rust defaults to private
382 }
383
384 /// extractRustReturnType (languages/rust.ts:14).
385 fn return_type_of(&self, node: Node) -> Option<String> {

Callers 3

extract_fn_or_methodMethod · 0.45
extract_aggregateMethod · 0.45
extract_enumMethod · 0.45

Calls 1

textMethod · 0.65

Tested by

no test coverage detected