Skip to main content

PluginRegistry

Struct PluginRegistry 

Source
pub struct PluginRegistry { /* private fields */ }

Implementations§

Source§

impl PluginRegistry

Source

pub fn new() -> Self

Source

pub fn register(&mut self, plugin: Box<dyn MirPlugin>)

Source

pub fn is_empty(&self) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn plugin_names(&self) -> Vec<&str>

Source

pub fn hooks(&self) -> HookFlags

Source

pub fn stub_files(&self) -> Vec<PathBuf>

All stub files contributed by registered plugins.

Source

pub fn has_function_provider(&self, function_id: &str) -> bool

Whether any plugin provides a return type for function_id (pre-normalized). Cheap gate before building the provider event.

Source

pub fn has_method_provider(&self, fqcn_normalized: &str) -> bool

Source

pub fn has_any_function_provider(&self) -> bool

Whether any registered plugin declares any return-type provider — used to skip id normalization entirely on the hot call path.

Source

pub fn has_any_method_provider(&self) -> bool

Source

pub fn function_return_type( &self, event: &FunctionReturnTypeProviderEvent<'_>, ) -> Option<ProvidedType>

First-plugin-wins return type for a function call, in registration order (matching Psalm, where the last registered provider for an id replaces earlier ones — we instead chain until one returns Some).

Source

pub fn method_return_type( &self, fqcn_normalized: &str, event: &MethodReturnTypeProviderEvent<'_>, ) -> Option<ProvidedType>

Source

pub fn has_any_class_property_provider(&self) -> bool

Source

pub fn has_class_property_marker(&self, marker_normalized: &str) -> bool

Whether any plugin registered marker_normalized (pre-normalized) as a class-property-provider marker. The analyzer calls this for the receiver’s own class and each ancestor.

Source

pub fn class_property( &self, marker_normalized: &str, event: &ClassPropertyProviderEvent<'_>, ) -> Option<ProvidedType>

Source

pub fn after_expression_analysis( &self, event: &mut AfterExpressionAnalysisEvent<'_>, )

Source

pub fn after_statement_analysis( &self, event: &mut AfterStatementAnalysisEvent<'_>, )

Source

pub fn after_function_call_analysis( &self, event: &mut AfterFunctionCallAnalysisEvent<'_>, )

Source

pub fn after_method_call_analysis( &self, event: &mut AfterMethodCallAnalysisEvent<'_>, )

Source

pub fn before_add_issue(&self, issue: &Issue) -> bool

false when some plugin vetoed the issue. First non-None wins.

Source

pub fn after_codebase_populated( &self, event: &mut AfterCodebasePopulatedEvent<'_>, )

Trait Implementations§

Source§

impl Default for PluginRegistry

Source§

fn default() -> PluginRegistry

Returns the “default value” for a type. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.