Skip to main content

PythonAdapter

Struct PythonAdapter 

Source
pub struct PythonAdapter;
Expand description

Python language adapter.

Implementations§

Source§

impl PythonAdapter

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Clone for PythonAdapter

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PythonAdapter

Source§

impl Debug for PythonAdapter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PythonAdapter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl LanguageAdapter for PythonAdapter

Source§

fn language(&self) -> &str

Stable language identifier — “python”, “typescript”, …
Source§

fn file_extensions(&self) -> &'static [&'static str]

File extensions this adapter handles, without the leading dot. Used by the shared index pipeline for file dispatch. Default: empty (adapter is never auto-selected by extension).
Source§

fn parse_symbols(&self, file: &str, source: &str) -> Result<Vec<ParsedSymbol>>

Parse a file and return declared symbols.
Source§

fn infer_effects(&self, _source: &str, symbol: &ParsedSymbol) -> Vec<Effect>

Heuristic effect inference for a symbol. Returns an empty Vec when the adapter has no opinion (author must declare explicitly).
Source§

fn infer_service_endpoints( &self, file: &str, source: &str, symbols: &[ParsedSymbol], ) -> Vec<DetectedEndpoint>

Detect cross-service endpoints (HTTP routes/clients, pub-sub emit/listen) in a file. Returns DetectedEndpoints attributed to the owning symbol by qname; the index pipeline enriches them with repo + symbol identity. Whole-file signature (not per-symbol) because the signal often lives just outside a symbol’s body (e.g. a route decorator above a def). Default: empty — adapters opt in. Read more
Source§

fn resolve_endpoint_prefixes( &self, files: &[(String, String)], endpoints: &mut Vec<ServiceEndpoint>, )

Project-level pass (Plan Q t-004b): rewrite endpoint contracts using cross-file context — e.g. resolving nested router-mount prefix chains (app.include_router(api, prefix="/api") → api.include_router(calc, prefix="/calc") → @calc.get("/x") = /api/calc/x) that span files. files is (path, source) for THIS adapter’s language; endpoints is the full project set — the adapter must only touch its own. Runs once after per-file detection. Default: no-op.
Source§

fn extract_dataflow( &self, file: &str, source: &str, symbols: &[ParsedSymbol], _workspace: &WorkspaceSymbols, ) -> Vec<DetectedDataFlow>

Detect intra-process data-flow sites (arg → param at call sites) in a file. Returns DetectedDataFlow naming caller/callee by qname plus the argument and its position; the index pipeline resolves the callee’s parameter name and symbol identity. Default: empty — adapters opt in. Read more
Source§

fn extract_call_edges( &self, file: &str, source: &str, symbols: &[ParsedSymbol], workspace: &WorkspaceSymbols, ) -> Vec<CallEdge>

Extract call edges from a file’s parsed symbols. Returned pairs are (caller_qname, callee_qname). The adapter is free to use heuristics; resolution quality is best-effort. Read more
Source§

fn scan_dynamic_dispatch( &self, file: &str, source: &str, ) -> Vec<DynamicDispatchHint>

Plan L t-005: report dynamic-dispatch sites in the file’s source. These are call patterns the static call-graph walker can’t resolve (e.g. getattr(obj, attr_name)(args), callback-by-argument, metaclass tricks). Returning a non-empty list signals to the indexer that some call paths in this file won’t show up in the graph; the indexer surfaces a one-line warning so agents/humans know the missing edges aren’t a bug, they’re a known limit. Read more
Source§

fn report_unresolved_calls( &self, file: &str, source: &str, symbols: &[ParsedSymbol], workspace: &WorkspaceSymbols, ) -> Vec<UnresolvedCall>

Plan L t-006: report call sites in this file whose function position couldn’t be resolved to a workspace qname. Default: empty. Adapters that can compute this cheaply override.
Source§

fn extract_property_types( &self, _symbols: &[ParsedSymbol], ) -> HashMap<String, String>

Extract stored property declarations from a file’s parsed symbols, returning "EnclosingTypeSimpleName.propertyName" → "TypeSimpleName". Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.