Skip to main content

PythonUsageSource

Trait PythonUsageSource 

Source
pub trait PythonUsageSource: PythonSource {
    // Required methods
    fn usage_index(&self) -> Arc<PythonUsageIndex> ⓘ;
    fn module_binding_timeline(
        &self,
        file: &ProjectFile,
        build: &mut dyn FnMut() -> ModuleBindingTimeline,
    ) -> Arc<ModuleBindingTimeline> ⓘ;
    fn scope_facts(
        &self,
        file: &ProjectFile,
        build: &mut dyn FnMut() -> Option<PythonScopeFacts>,
    ) -> Option<Arc<PythonScopeFacts>>;
    fn usage_index_with_cancellation(
        &self,
        cancellation: &CancellationToken,
    ) -> Option<Arc<PythonUsageIndex>>;
}
Expand description

PythonSource plus the built usage index. Everything reached from the export/importer walks needs it; the index build itself must not.

Required Methods§

Source

fn usage_index(&self) -> Arc<PythonUsageIndex> ⓘ

Source

fn module_binding_timeline( &self, file: &ProjectFile, build: &mut dyn FnMut() -> ModuleBindingTimeline, ) -> Arc<ModuleBindingTimeline> ⓘ

Source

fn scope_facts( &self, file: &ProjectFile, build: &mut dyn FnMut() -> Option<PythonScopeFacts>, ) -> Option<Arc<PythonScopeFacts>>

Source

fn usage_index_with_cancellation( &self, cancellation: &CancellationToken, ) -> Option<Arc<PythonUsageIndex>>

A cancelled initialization publishes no partial index.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§