GtBridge.Analysis.Interfaces (gt_bridge v0.19.2)

Copy Markdown View Source

I list the behaviours and protocols an application defines, each with the modules implementing it.

A behaviour row carries its @callback specs and the implementors found among loaded modules; a protocol row carries its function list and its impls. Everything travels as plain values, so GT can render the interface -> implementor tree without round trips.

Public API

Summary

Functions

I return true when mod has anything to draw: it defines an interface, declares behaviours, or a loaded impl module targets it.

I return the behaviours and protocols defined by app's modules.

I return true when mod defines a behaviour or a protocol.

I return one module's interface facts: the behaviours and protocols it implements, and its own row (with implementors) when it is itself one.

Functions

has_interfaces?(mod)

@spec has_interfaces?(module()) :: boolean()

I return true when mod has anything to draw: it defines an interface, declares behaviours, or a loaded impl module targets it.

Cheap enough for an eager tab guard; the impl check matches module names before touching exports.

in_app(app)

@spec in_app(atom()) :: [map()]

I return the behaviours and protocols defined by app's modules.

Implementors are searched across all loaded modules, so another application implementing one of app's behaviours is listed too.

interface?(mod)

@spec interface?(module()) :: boolean()

I return true when mod defines a behaviour or a protocol.

Cheap enough for an eager tab-bar guard: two export checks.

of_module(mod)

@spec of_module(module()) :: map()

I return one module's interface facts: the behaviours and protocols it implements, and its own row (with implementors) when it is itself one.

One pass over the code server, so a documentation tab can call me on demand without lag.