Skip to main content

NativePluginRule

Struct NativePluginRule 

Source
pub struct NativePluginRule<P: Plugin> { /* private fields */ }
Expand description

Adapter that wraps a Plugin implementation into a LintRule.

This allows running WASM plugin code natively, bypassing the serialization/deserialization and WASM VM overhead.

Implementations§

Source§

impl<P: Plugin> NativePluginRule<P>

Source

pub fn new() -> Self

Source

pub fn with_plugin(plugin: P) -> Self

Create a NativePluginRule with a pre-configured plugin instance

Trait Implementations§

Source§

impl<P: Plugin> Default for NativePluginRule<P>

Source§

fn default() -> Self

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

impl<P: Plugin + Send + Sync> LintRule for NativePluginRule<P>

Source§

fn name(&self) -> &'static str

Unique identifier for this rule (e.g. "server-tokens-enabled").
Source§

fn category(&self) -> &'static str

Category this rule belongs to (e.g. "security", "style").
Source§

fn description(&self) -> &'static str

One-line human-readable description of what this rule checks.
Source§

fn check(&self, config: &Config, path: &Path) -> Vec<CommonLintError>

Run the rule against config (parsed from path) and return diagnostics.
Source§

fn severity(&self) -> Option<&str>

Get severity level (for plugins)
Source§

fn why(&self) -> Option<&str>

Get detailed explanation of why this rule exists
Source§

fn bad_example(&self) -> Option<&str>

Get example of bad configuration
Source§

fn good_example(&self) -> Option<&str>

Get example of good configuration
Source§

fn references(&self) -> Option<Vec<String>>

Get reference URLs
Source§

fn check_with_serialized_config( &self, config: &Config, path: &Path, _serialized_config: &str, ) -> Vec<LintError>

Check with pre-serialized config JSON (optimization for WASM plugins) Read more

Auto Trait Implementations§

§

impl<P> Freeze for NativePluginRule<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for NativePluginRule<P>
where P: RefUnwindSafe,

§

impl<P> Send for NativePluginRule<P>
where P: Send,

§

impl<P> Sync for NativePluginRule<P>
where P: Sync,

§

impl<P> Unpin for NativePluginRule<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for NativePluginRule<P>
where P: UnsafeUnpin,

§

impl<P> UnwindSafe for NativePluginRule<P>
where P: UnwindSafe,

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> 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, 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.